<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Interactive BOM for KiCAD</title>
  <style type="text/css">
:root {
  --pcb-edge-color: black;
  --pad-color: #878787;
  --pad-color-highlight: #D04040;
  --pin1-outline-color: #ffb629;
  --pin1-outline-color-highlight: #b4ff03;
}

html, body {
  margin: 0px;
  height: 100%;
  font-family: Verdana, sans-serif;
}

.dark {
  --pcb-edge-color: #eee;
  --pad-color: #808080;
  --pin1-outline-color: #ffa800;
  --pin1-outline-color-highlight: #ccff00;
  background-color: #252c30;
  color: #eee;
}

button {
  background-color: #eee;
  border: 1px solid #888;
  color: black;
  height: 44px;
  width: 44px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  font-weight: bolder;
}

.dark button {
  /* This will be inverted */
  background-color: #c3b7b5;
}

button.depressed {
  background-color: #0a0;
  color: white;
}

.dark button.depressed {
  /* This will be inverted */
  background-color: #b3b;
}

button:focus {
  outline: 0;
}

button#tb-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.32 290.12h5.82M1.32 291.45h5.82' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 292.5v4.23M.26 292.63H8.2' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='1.35' y='295.73'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
  background-size: 32px 32px;
  background-position: 5px 5px;
  background-repeat: no-repeat;
}

button#lr-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.06 290.12H3.7m-2.64 1.33H3.7m-2.64 1.32H3.7m-2.64 1.3H3.7m-2.64 1.33H3.7' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 288.8v7.94m0-4.11h3.96' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='5.11' y='291.96'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
  background-size: 32px 32px;
  background-position: 5px 5px;
  background-repeat: no-repeat;
}

button#bom-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)' fill='none' stroke='%23000' stroke-width='.4'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' stroke-linejoin='round'/%3E%3Cpath d='M1.59 290.12h5.29M1.59 291.45h5.33M1.59 292.75h5.33M1.59 294.09h5.33M1.59 295.41h5.33'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 32px 32px;
  background-position: 5px 5px;
  background-repeat: no-repeat;
}

button#copy {
  background-image: url("data:image/svg+xml,%3Csvg height='48' viewBox='0 0 48 48' width='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h48v48h-48z' fill='none'/%3E%3Cpath d='M32 2h-24c-2.21 0-4 1.79-4 4v28h4v-28h24v-4zm6 8h-22c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h22c2.21 0 4-1.79 4-4v-28c0-2.21-1.79-4-4-4zm0 32h-22v-28h22v28z'/%3E%3C/svg%3E");
  background-position: 6px 6px;
  background-repeat: no-repeat;
  background-size: 26px 26px;
  border-radius: 6px;
  height: 40px;
  width: 40px;
  margin: 10px 5px;
}

button#copy:active {
    box-shadow: inset 0px 0px 5px #6c6c6c;
}

textarea.clipboard-temp {
  position: fixed;
  top: 0;
  left: 0;
  width: 2em;
  height: 2em;
  padding: 0;
  border: None;
  outline: None;
  box-shadow: None;
  background: transparent;
}

.left-most-button {
  border-right: 0;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.middle-button {
  border-right: 0;
}

.right-most-button {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.button-container {
  font-size: 0;
}

.dark .button-container {
  filter: invert(1);
}

@media print {
  .hideonprint {
    display: none;
  }
}

canvas {
  cursor: crosshair;
}

canvas:active {
  cursor: grabbing;
}

.fileinfo {
  width: 100%;
  max-width: 1000px;
  border: none;
  padding: 5px;
}

.fileinfo .title {
  font-size: 20pt;
  font-weight: bold;
}

.fileinfo td {
  overflow: hidden;
  white-space: nowrap;
  max-width: 1px;
  width: 50%;
  text-overflow: ellipsis;
}

.bom {
  border-collapse: collapse;
  font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  font-size: 10pt;
  table-layout: fixed;
  width: 100%;
  margin-top: 1px;
}

.bom th, .bom td {
  border: 1px solid black;
  padding: 5px;
  word-wrap: break-word;
  text-align: center;
  position: relative;
}

.dark .bom th, .dark .bom td {
  border: 1px solid #777;
}

.bom th {
  background-color: #CCCCCC;
  background-clip: padding-box;
}

.dark .bom th {
  background-color: #3b4749;
}

.bom tr.highlighted:nth-child(n) {
  background-color: #cfc;
}

.dark .bom tr.highlighted:nth-child(n) {
  background-color: #226022;
}

.bom tr:nth-child(even) {
  background-color: #f2f2f2;
}

.dark .bom tr:nth-child(even) {
  background-color: #313b40;
}

.bom tr {
  transition: background-color 0.2s;
}

.bom .numCol {
  width: 25px;
}

.bom .Description {
  width: 10%;
}

.bom .Part {
  width: 10%;
}

.bom .Value {
  width: 15%;
}

.bom .Quantity {
  width: 65px;
}

.bom th .sortmark {
  position: absolute;
  right: 1px;
  top: 1px;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #221 transparent;
  transform-origin: 50% 85%;
  transition: opacity 0.2s, transform 0.4s;
}

.dark .bom th .sortmark {
  filter: invert(1);
}

.bom th .sortmark.none {
  opacity: 0;
}

.bom th .sortmark.desc {
  transform: rotate(180deg);
}

.bom th:hover .sortmark.none {
  opacity: 0.5;
}

.bom .bom-checkbox {
  width: 30px;
  position: relative;
  user-select: none;
  -moz-user-select: none;
}

.bom .bom-checkbox:before {
  content: "";
  position: absolute;
  border-width: 15px;
  border-style: solid;
  border-color: #51829f transparent transparent transparent;
  visibility: hidden;
  top: -15px;
}

.bom .bom-checkbox:after {
  content: "Double click to set/unset all";
  position: absolute;
  color: white;
  top: -35px;
  left: -26px;
  background: #51829f;
  padding: 5px 15px;
  border-radius: 8px;
  white-space: nowrap;
  visibility: hidden;
}

.bom .bom-checkbox:hover:before, .bom .bom-checkbox:hover:after {
  visibility: visible;
  transition: visibility 0.2s linear 1s;
}

.split {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: inherit;
}

.split.split-horizontal, .gutter.gutter-horizontal {
  height: 100%;
  float: left;
}

.gutter {
  background-color: #ddd;
  background-repeat: no-repeat;
  background-position: 50%;
  transition: background-color 0.3s;
}

.dark .gutter {
  background-color: #777;
}

.gutter.gutter-horizontal {
  background-image: url('');
  cursor: ew-resize;
  width: 5px;
}

.gutter.gutter-vertical {
  background-image: url('');
  cursor: ns-resize;
  height: 5px;
}

.searchbox {
  float: left;
  height: 40px;
  margin: 10px 5px;
  padding: 12px 32px;
  font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  font-size: 18px;
  box-sizing: border-box;
  border: 1px solid #888;
  border-radius: 6px;
  outline: none;
  background-color: #eee;
  transition: background-color 0.2s, border 0.2s;
  background-image: url('');
  background-position: 10px 10px;
  background-repeat: no-repeat;
}

.dark .searchbox {
  background-color: #111;
  color: #eee;
}

.searchbox::placeholder {
  color: #ccc;
}

.dark .searchbox::placeholder {
  color: #666;
}

.filter {
  width: calc(60% - 64px);
}

.reflookup {
  width: calc(40% - 10px);
}

input[type=text]:focus {
  background-color: white;
  border: 1px solid #333;
}

.dark input[type=text]:focus {
  background-color: #333;
  border: 1px solid #ccc;
}

mark.highlight {
  background-color: #5050ff;
  color: #fff;
  padding: 2px;
  border-radius: 6px;
}

.dark mark.highlight {
  background-color: #76a6da;
  color: #111;
}

.menubtn {
  background-color: white;
  font-size: 16px;
  border: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 20 20'%3E%3Cpath fill='none' d='M0 0h20v20H0V0z'/%3E%3Cpath d='M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z'/%3E%3C/svg%3E%0A");
  background-position: center;
  background-repeat: no-repeat;
}

.dark .menubtn {
  filter: invert(1);
}

.menu {
  position: relative;
  display: inline-block;
}

.menu-content {
  display: none;
  position: absolute;
  background-color: white;
  right: 0;
  min-width: 300px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 100;
  padding: 8px;
}

.dark .menu-content {
  background-color: #111;
}

.menu:hover .menu-content {
  display: block;
}

.menu:hover .menubtn {
  background-color: #eee;
}

.dark .menu:hover .menubtn {}

.menu-label {
  display: inline-block;
  padding: 8px;
  border: 1px solid #ccc;
  border-top: 0;
  width: calc(100% - 18px);
}

.menu-label-top {
  border-top: 1px solid #ccc;
}

.menu-textbox {
  float: left;
  height: 24px;
  margin: 10px 5px;
  padding: 5px 5px;
  font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #888;
  border-radius: 4px;
  outline: none;
  background-color: #eee;
  transition: background-color 0.2s, border 0.2s;
  width: calc(100% - 10px);
}

.dark .menu-textbox {
  background-color: #222;
  color: #eee;
}

#topmostdiv {
  transition: background-color 0.3s;
}

#top {
  height: 78px;
  border-bottom: 2px solid black;
}

.dark #top {
  border-bottom: 2px solid #ccc;
}

#dbg {
  display: block;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #aaa;
}

::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  margin: 3px 0;
  padding: 0;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
  border-radius: 3px;
}

.slider:hover {
  opacity: 1;
}

.slider:focus {
  outline: none;
}

.slider::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #d3d3d3;
  border-radius: 3px;
  border: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0a0;
  cursor: pointer;
  margin-top: -4px;
}

.dark .slider::-webkit-slider-thumb {
  background: #3d3;
}

.slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0a0;
  cursor: pointer;
}

.slider::-moz-range-track {
  height: 8px;
  background: #d3d3d3;
  border-radius: 3px;
}

.dark .slider::-moz-range-thumb {
  background: #3d3;
}

.slider::-ms-track {
  width: 100%;
  height: 8px;
  border-width: 3px 0;
  background: transparent;
  border-color: transparent;
  color: transparent;
  transition: opacity .2s;
}

.slider::-ms-fill-lower {
  background: #d3d3d3;
  border: none;
  border-radius: 3px;
}

.slider::-ms-fill-upper {
  background: #d3d3d3;
  border: none;
  border-radius: 3px;
}

.slider::-ms-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0a0;
  cursor: pointer;
  margin: 0;
}

.shameless-plug {
  font-size: 0.8em;
  text-align: center;
  display: block;
}

.shameless-plug a {
  color: #0278a4;
}

.dark .shameless-plug a {
  color: #00b9fd;
}

  </style>
  <script type="text/javascript" >
///////////////////////////////////////////////
/*
  Split.js - v1.3.5
  MIT License
  https://github.com/nathancahill/Split.js
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Split=t()}(this,function(){"use strict";var e=window,t=e.document,n="addEventListener",i="removeEventListener",r="getBoundingClientRect",s=function(){return!1},o=e.attachEvent&&!e[n],a=["","-webkit-","-moz-","-o-"].filter(function(e){var n=t.createElement("div");return n.style.cssText="width:"+e+"calc(9px)",!!n.style.length}).shift()+"calc",l=function(e){return"string"==typeof e||e instanceof String?t.querySelector(e):e};return function(u,c){function z(e,t,n){var i=A(y,t,n);Object.keys(i).forEach(function(t){return e.style[t]=i[t]})}function h(e,t){var n=B(y,t);Object.keys(n).forEach(function(t){return e.style[t]=n[t]})}function f(e){var t=E[this.a],n=E[this.b],i=t.size+n.size;t.size=e/this.size*i,n.size=i-e/this.size*i,z(t.element,t.size,this.aGutterSize),z(n.element,n.size,this.bGutterSize)}function m(e){var t;this.dragging&&((t="touches"in e?e.touches[0][b]-this.start:e[b]-this.start)<=E[this.a].minSize+M+this.aGutterSize?t=E[this.a].minSize+this.aGutterSize:t>=this.size-(E[this.b].minSize+M+this.bGutterSize)&&(t=this.size-(E[this.b].minSize+this.bGutterSize)),f.call(this,t),c.onDrag&&c.onDrag())}function g(){var e=E[this.a].element,t=E[this.b].element;this.size=e[r]()[y]+t[r]()[y]+this.aGutterSize+this.bGutterSize,this.start=e[r]()[G]}function d(){var t=this,n=E[t.a].element,r=E[t.b].element;t.dragging&&c.onDragEnd&&c.onDragEnd(),t.dragging=!1,e[i]("mouseup",t.stop),e[i]("touchend",t.stop),e[i]("touchcancel",t.stop),t.parent[i]("mousemove",t.move),t.parent[i]("touchmove",t.move),delete t.stop,delete t.move,n[i]("selectstart",s),n[i]("dragstart",s),r[i]("selectstart",s),r[i]("dragstart",s),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",t.gutter.style.cursor="",t.parent.style.cursor=""}function S(t){var i=this,r=E[i.a].element,o=E[i.b].element;!i.dragging&&c.onDragStart&&c.onDragStart(),t.preventDefault(),i.dragging=!0,i.move=m.bind(i),i.stop=d.bind(i),e[n]("mouseup",i.stop),e[n]("touchend",i.stop),e[n]("touchcancel",i.stop),i.parent[n]("mousemove",i.move),i.parent[n]("touchmove",i.move),r[n]("selectstart",s),r[n]("dragstart",s),o[n]("selectstart",s),o[n]("dragstart",s),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",o.style.userSelect="none",o.style.webkitUserSelect="none",o.style.MozUserSelect="none",o.style.pointerEvents="none",i.gutter.style.cursor=j,i.parent.style.cursor=j,g.call(i)}function v(e){e.forEach(function(t,n){if(n>0){var i=F[n-1],r=E[i.a],s=E[i.b];r.size=e[n-1],s.size=t,z(r.element,r.size,i.aGutterSize),z(s.element,s.size,i.bGutterSize)}})}function p(){F.forEach(function(e){e.parent.removeChild(e.gutter),E[e.a].element.style[y]="",E[e.b].element.style[y]=""})}void 0===c&&(c={});var y,b,G,E,w=l(u[0]).parentNode,D=e.getComputedStyle(w).flexDirection,U=c.sizes||u.map(function(){return 100/u.length}),k=void 0!==c.minSize?c.minSize:100,x=Array.isArray(k)?k:u.map(function(){return k}),L=void 0!==c.gutterSize?c.gutterSize:10,M=void 0!==c.snapOffset?c.snapOffset:30,O=c.direction||"horizontal",j=c.cursor||("horizontal"===O?"ew-resize":"ns-resize"),C=c.gutter||function(e,n){var i=t.createElement("div");return i.className="gutter gutter-"+n,i},A=c.elementStyle||function(e,t,n){var i={};return"string"==typeof t||t instanceof String?i[e]=t:i[e]=o?t+"%":a+"("+t+"% - "+n+"px)",i},B=c.gutterStyle||function(e,t){return n={},n[e]=t+"px",n;var n};"horizontal"===O?(y="width","clientWidth",b="clientX",G="left","paddingLeft"):"vertical"===O&&(y="height","clientHeight",b="clientY",G="top","paddingTop");var F=[];return E=u.map(function(e,t){var i,s={element:l(e),size:U[t],minSize:x[t]};if(t>0&&(i={a:t-1,b:t,dragging:!1,isFirst:1===t,isLast:t===u.length-1,direction:O,parent:w},i.aGutterSize=L,i.bGutterSize=L,i.isFirst&&(i.aGutterSize=L/2),i.isLast&&(i.bGutterSize=L/2),"row-reverse"===D||"column-reverse"===D)){var a=i.a;i.a=i.b,i.b=a}if(!o&&t>0){var c=C(t,O);h(c,L),c[n]("mousedown",S.bind(i)),c[n]("touchstart",S.bind(i)),w.insertBefore(c,s.element),i.gutter=c}0===t||t===u.length-1?z(s.element,s.size,L/2):z(s.element,s.size,L);var f=s.element[r]()[y];return f<s.minSize&&(s.minSize=f),t>0&&F.push(i),s}),o?{setSizes:v,destroy:p}:{setSizes:v,getSizes:function(){return E.map(function(e){return e.size})},collapse:function(e){if(e===F.length){var t=F[e-1];g.call(t),o||f.call(t,t.size-t.bGutterSize)}else{var n=F[e];g.call(n),o||f.call(n,n.aGutterSize)}},destroy:p}}});

///////////////////////////////////////////////

///////////////////////////////////////////////
var config = {"redraw_on_drag": true, "highlight_pin1": false, "extra_fields": [], "dark_mode": false, "bom_view": "left-right", "board_rotation": 0, "checkboxes": "Sourced,Placed", "show_silkscreen": true, "layer_view": "FB"}
///////////////////////////////////////////////

///////////////////////////////////////////////
var pcbdata = {"font_data": {" ": {"l": [], "w": 0.7619047619047619}, "/": {"l": [[[0.9523809523809523, -1.0952380952380951], [0.09523809523809518, 0.19047619047619047]]], "w": 1.0476190476190474}, ".": {"l": [[[0.23809523809523808, -0.14285714285714285], [0.2857142857142857, -0.09523809523809523], [0.23809523809523808, -0.047619047619047616], [0.19047619047619047, -0.09523809523809523], [0.23809523809523808, -0.14285714285714285], [0.23809523809523808, -0.047619047619047616]]], "w": 0.47619047619047616}, "1": {"l": [[[0.7619047619047619, -0.047619047619047616], [0.19047619047619047, -0.047619047619047616]], [[0.47619047619047616, -0.047619047619047616], [0.47619047619047616, -1.0476190476190474], [0.38095238095238093, -0.9047619047619047], [0.2857142857142857, -0.8095238095238095], [0.19047619047619047, -0.7619047619047619]]], "w": 0.9523809523809523}, "3": {"l": [[[0.14285714285714285, -1.0476190476190474], [0.7619047619047619, -1.0476190476190474], [0.42857142857142855, -0.6666666666666666], [0.5714285714285714, -0.6666666666666666], [0.6666666666666666, -0.6190476190476191], [0.7142857142857142, -0.5714285714285714], [0.7619047619047619, -0.47619047619047616], [0.7619047619047619, -0.23809523809523808], [0.7142857142857142, -0.14285714285714285], [0.6666666666666666, -0.09523809523809523], [0.5714285714285714, -0.047619047619047616], [0.2857142857142857, -0.047619047619047616], [0.19047619047619047, -0.09523809523809523], [0.14285714285714285, -0.14285714285714285]]], "w": 0.9523809523809523}, "2": {"l": [[[0.19047619047619047, -0.9523809523809523], [0.23809523809523808, -1.0], [0.3333333333333333, -1.0476190476190474], [0.5714285714285714, -1.0476190476190474], [0.6666666666666666, -1.0], [0.7142857142857142, -0.9523809523809523], [0.7619047619047619, -0.8571428571428571], [0.7619047619047619, -0.7619047619047619], [0.7142857142857142, -0.6190476190476191], [0.14285714285714285, -0.047619047619047616], [0.7619047619047619, -0.047619047619047616]]], "w": 0.9523809523809523}, "4": {"l": [[[0.6666666666666666, -0.7142857142857142], [0.6666666666666666, -0.047619047619047616]], [[0.42857142857142855, -1.0952380952380951], [0.19047619047619047, -0.38095238095238093], [0.8095238095238095, -0.38095238095238093]]], "w": 0.9523809523809523}, "J": {"l": [[[0.5238095238095237, -1.0476190476190474], [0.5238095238095237, -0.3333333333333333], [0.47619047619047616, -0.19047619047619047], [0.38095238095238093, -0.09523809523809523], [0.23809523809523808, -0.047619047619047616], [0.14285714285714285, -0.047619047619047616]]], "w": 0.7619047619047619}, "S": {"l": [[[0.19047619047619047, -0.09523809523809523], [0.3333333333333333, -0.047619047619047616], [0.5714285714285714, -0.047619047619047616], [0.6666666666666666, -0.09523809523809523], [0.7142857142857142, -0.14285714285714285], [0.7619047619047619, -0.23809523809523808], [0.7619047619047619, -0.3333333333333333], [0.7142857142857142, -0.42857142857142855], [0.6666666666666666, -0.47619047619047616], [0.5714285714285714, -0.5238095238095237], [0.38095238095238093, -0.5714285714285714], [0.2857142857142857, -0.6190476190476191], [0.23809523809523808, -0.6666666666666666], [0.19047619047619047, -0.7619047619047619], [0.19047619047619047, -0.8571428571428571], [0.23809523809523808, -0.9523809523809523], [0.2857142857142857, -1.0], [0.38095238095238093, -1.0476190476190474], [0.6190476190476191, -1.0476190476190474], [0.7619047619047619, -1.0]]], "w": 0.9523809523809523}, "W": {"l": [[[0.14285714285714285, -1.0476190476190474], [0.38095238095238093, -0.047619047619047616], [0.5714285714285714, -0.7619047619047619], [0.7619047619047619, -0.047619047619047616], [1.0, -1.0476190476190474]]], "w": 1.1428571428571428}, "a": {"l": [[[0.6666666666666666, -0.047619047619047616], [0.6666666666666666, -0.5714285714285714], [0.6190476190476191, -0.6666666666666666], [0.5238095238095237, -0.7142857142857142], [0.3333333333333333, -0.7142857142857142], [0.23809523809523808, -0.6666666666666666]], [[0.6666666666666666, -0.09523809523809523], [0.5714285714285714, -0.047619047619047616], [0.3333333333333333, -0.047619047619047616], [0.23809523809523808, -0.09523809523809523], [0.19047619047619047, -0.19047619047619047], [0.19047619047619047, -0.2857142857142857], [0.23809523809523808, -0.38095238095238093], [0.3333333333333333, -0.42857142857142855], [0.5714285714285714, -0.42857142857142855], [0.6666666666666666, -0.47619047619047616]]], "w": 0.9047619047619047}, "c": {"l": [[[0.6666666666666666, -0.09523809523809523], [0.5714285714285714, -0.047619047619047616], [0.38095238095238093, -0.047619047619047616], [0.2857142857142857, -0.09523809523809523], [0.23809523809523808, -0.14285714285714285], [0.19047619047619047, -0.23809523809523808], [0.19047619047619047, -0.5238095238095237], [0.23809523809523808, -0.6190476190476191], [0.2857142857142857, -0.6666666666666666], [0.38095238095238093, -0.7142857142857142], [0.5714285714285714, -0.7142857142857142], [0.6666666666666666, -0.6666666666666666]]], "w": 0.8571428571428571}, "b": {"l": [[[0.23809523809523808, -0.047619047619047616], [0.23809523809523808, -1.0476190476190474]], [[0.23809523809523808, -0.6666666666666666], [0.3333333333333333, -0.7142857142857142], [0.5238095238095237, -0.7142857142857142], [0.6190476190476191, -0.6666666666666666], [0.6666666666666666, -0.6190476190476191], [0.7142857142857142, -0.5238095238095237], [0.7142857142857142, -0.23809523809523808], [0.6666666666666666, -0.14285714285714285], [0.6190476190476191, -0.09523809523809523], [0.5238095238095237, -0.047619047619047616], [0.3333333333333333, -0.047619047619047616], [0.23809523809523808, -0.09523809523809523]]], "w": 0.9047619047619047}, "g": {"l": [[[0.6666666666666666, -0.7142857142857142], [0.6666666666666666, 0.09523809523809523], [0.6190476190476191, 0.19047619047619047], [0.5714285714285714, 0.23809523809523808], [0.47619047619047616, 0.2857142857142857], [0.3333333333333333, 0.2857142857142857], [0.23809523809523808, 0.23809523809523808]], [[0.6666666666666666, -0.09523809523809523], [0.5714285714285714, -0.047619047619047616], [0.38095238095238093, -0.047619047619047616], [0.2857142857142857, -0.09523809523809523], [0.23809523809523808, -0.14285714285714285], [0.19047619047619047, -0.23809523809523808], [0.19047619047619047, -0.5238095238095237], [0.23809523809523808, -0.6190476190476191], [0.2857142857142857, -0.6666666666666666], [0.38095238095238093, -0.7142857142857142], [0.5714285714285714, -0.7142857142857142], [0.6666666666666666, -0.6666666666666666]]], "w": 0.9047619047619047}, "i": {"l": [[[0.23809523809523808, -0.047619047619047616], [0.23809523809523808, -0.7142857142857142]], [[0.23809523809523808, -1.0476190476190474], [0.19047619047619047, -1.0], [0.23809523809523808, -0.9523809523809523], [0.2857142857142857, -1.0], [0.23809523809523808, -1.0476190476190474], [0.23809523809523808, -0.9523809523809523]]], "w": 0.47619047619047616}, "h": {"l": [[[0.23809523809523808, -0.047619047619047616], [0.23809523809523808, -1.0476190476190474]], [[0.6666666666666666, -0.047619047619047616], [0.6666666666666666, -0.5714285714285714], [0.6190476190476191, -0.6666666666666666], [0.5238095238095237, -0.7142857142857142], [0.38095238095238093, -0.7142857142857142], [0.2857142857142857, -0.6666666666666666], [0.23809523809523808, -0.6190476190476191]]], "w": 0.9047619047619047}, "j": {"l": [[[0.23809523809523808, -0.7142857142857142], [0.23809523809523808, 0.14285714285714285], [0.19047619047619047, 0.23809523809523808], [0.09523809523809523, 0.2857142857142857], [0.047619047619047616, 0.2857142857142857]], [[0.23809523809523808, -1.0476190476190474], [0.19047619047619047, -1.0], [0.23809523809523808, -0.9523809523809523], [0.2857142857142857, -1.0], [0.23809523809523808, -1.0476190476190474], [0.23809523809523808, -0.9523809523809523]]], "w": 0.47619047619047616}, "m": {"l": [[[0.23809523809523808, -0.047619047619047616], [0.23809523809523808, -0.7142857142857142]], [[0.23809523809523808, -0.6190476190476191], [0.2857142857142857, -0.6666666666666666], [0.38095238095238093, -0.7142857142857142], [0.5238095238095237, -0.7142857142857142], [0.6190476190476191, -0.6666666666666666], [0.6666666666666666, -0.5714285714285714], [0.6666666666666666, -0.047619047619047616]], [[0.6666666666666666, -0.5714285714285714], [0.7142857142857142, -0.6666666666666666], [0.8095238095238095, -0.7142857142857142], [0.9523809523809523, -0.7142857142857142], [1.0476190476190474, -0.6666666666666666], [1.0952380952380951, -0.5714285714285714], [1.0952380952380951, -0.047619047619047616]]], "w": 1.3333333333333333}, "o": {"l": [[[0.38095238095238093, -0.047619047619047616], [0.2857142857142857, -0.09523809523809523], [0.23809523809523808, -0.14285714285714285], [0.19047619047619047, -0.23809523809523808], [0.19047619047619047, -0.5238095238095237], [0.23809523809523808, -0.6190476190476191], [0.2857142857142857, -0.6666666666666666], [0.38095238095238093, -0.7142857142857142], [0.5238095238095237, -0.7142857142857142], [0.6190476190476191, -0.6666666666666666], [0.6666666666666666, -0.6190476190476191], [0.7142857142857142, -0.5238095238095237], [0.7142857142857142, -0.23809523809523808], [0.6666666666666666, -0.14285714285714285], [0.6190476190476191, -0.09523809523809523], [0.5238095238095237, -0.047619047619047616], [0.38095238095238093, -0.047619047619047616]]], "w": 0.9047619047619047}, "n": {"l": [[[0.23809523809523808, -0.7142857142857142], [0.23809523809523808, -0.047619047619047616]], [[0.23809523809523808, -0.6190476190476191], [0.2857142857142857, -0.6666666666666666], [0.38095238095238093, -0.7142857142857142], [0.5238095238095237, -0.7142857142857142], [0.6190476190476191, -0.6666666666666666], [0.6666666666666666, -0.5714285714285714], [0.6666666666666666, -0.047619047619047616]]], "w": 0.9047619047619047}, "s": {"l": [[[0.19047619047619047, -0.09523809523809523], [0.2857142857142857, -0.047619047619047616], [0.47619047619047616, -0.047619047619047616], [0.5714285714285714, -0.09523809523809523], [0.6190476190476191, -0.19047619047619047], [0.6190476190476191, -0.23809523809523808], [0.5714285714285714, -0.3333333333333333], [0.47619047619047616, -0.38095238095238093], [0.3333333333333333, -0.38095238095238093], [0.23809523809523808, -0.42857142857142855], [0.19047619047619047, -0.5238095238095237], [0.19047619047619047, -0.5714285714285714], [0.23809523809523808, -0.6666666666666666], [0.3333333333333333, -0.7142857142857142], [0.47619047619047616, -0.7142857142857142], [0.5714285714285714, -0.6666666666666666]]], "w": 0.8095238095238095}, "u": {"l": [[[0.6666666666666666, -0.7142857142857142], [0.6666666666666666, -0.047619047619047616]], [[0.23809523809523808, -0.7142857142857142], [0.23809523809523808, -0.19047619047619047], [0.2857142857142857, -0.09523809523809523], [0.38095238095238093, -0.047619047619047616], [0.5238095238095237, -0.047619047619047616], [0.6190476190476191, -0.09523809523809523], [0.6666666666666666, -0.14285714285714285]]], "w": 0.9047619047619047}, "t": {"l": [[[0.09523809523809523, -0.7142857142857142], [0.47619047619047616, -0.7142857142857142]], [[0.23809523809523808, -1.0476190476190474], [0.23809523809523808, -0.19047619047619047], [0.2857142857142857, -0.09523809523809523], [0.38095238095238093, -0.047619047619047616], [0.47619047619047616, -0.047619047619047616]]], "w": 0.5714285714285714}}, "modules": [{"layer": "F", "center": [110.94999999999999, 115.625], "pads": [{"layers": ["F"], "angle": -270.0, "pos": [109.55, 116.375], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.0999999999999999, 1.7]}, {"layers": ["F"], "angle": -270.0, "pos": [112.35, 116.375], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.0999999999999999, 1.7]}, {"layers": ["F"], "angle": -270.0, "pos": [109.55, 114.875], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [1.0999999999999999, 1.7]}, {"layers": ["F"], "angle": -270.0, "pos": [112.35, 114.875], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.0999999999999999, 1.7]}], "drawings": [], "ref": "D1", "bbox": {"pos": [108.024999, 113.649999], "size": [5.850002, 3.950002]}}, {"layer": "B", "center": [105.0, 118.89999999999999], "pads": [], "drawings": [], "ref": "G***", "bbox": {"pos": [103.60823599999999, 117.391319], "size": [2.722645, 3.022364]}}, {"layer": "B", "center": [104.6, 109.8], "pads": [], "drawings": [], "ref": "REF**", "bbox": {"pos": [102.293775, 103.87679899999999], "size": [4.648026, 11.873106]}}, {"layer": "B", "center": [116.94999999999999, 105.1], "pads": [], "drawings": [], "ref": "REF**", "bbox": {"pos": [116.69999999999999, 104.85], "size": [0.5, 0.5]}}, {"layer": "F", "center": [110.94999999999999, 121.675], "pads": [{"layers": ["F"], "angle": -0.0, "pos": [113.14999999999999, 122.8], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -0.0, "pos": [113.14999999999999, 120.55], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -0.0, "pos": [108.75, 122.8], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -0.0, "pos": [108.75, 120.55], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}], "drawings": [], "ref": "SW4", "bbox": {"pos": [108.07499899999999, 119.91999899999999], "size": [5.750001999999999, 3.5100019999999996]}}, {"layer": "F", "center": [116.94999999999999, 115.675], "pads": [{"layers": ["F"], "angle": -90.0, "pos": [118.07499999999999, 113.475], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -90.0, "pos": [115.82499999999999, 113.475], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -90.0, "pos": [118.07499999999999, 117.875], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -90.0, "pos": [115.82499999999999, 117.875], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}], "drawings": [], "ref": "SW3", "bbox": {"pos": [115.194999, 112.799999], "size": [3.5100019999999996, 5.750001999999999]}}, {"layer": "F", "center": [104.94999999999999, 115.675], "pads": [{"layers": ["F"], "angle": -270.0, "pos": [103.82499999999999, 117.875], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -270.0, "pos": [106.07499999999999, 117.875], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -270.0, "pos": [103.82499999999999, 113.475], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -270.0, "pos": [106.07499999999999, 113.475], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}], "drawings": [], "ref": "SW2", "bbox": {"pos": [103.194999, 112.799999], "size": [3.5100019999999996, 5.750001999999999]}}, {"layer": "F", "center": [110.94999999999999, 109.675], "pads": [{"layers": ["F"], "angle": -180.0, "pos": [108.75, 108.55], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -180.0, "pos": [108.75, 110.8], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -180.0, "pos": [113.14999999999999, 108.55], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.7999999999999999, 0.7]}, {"layers": ["F"], "angle": -180.0, "pos": [113.14999999999999, 110.8], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.7999999999999999, 0.7]}], "drawings": [], "ref": "SW1", "bbox": {"pos": [108.07499899999999, 107.91999899999999], "size": [5.750001999999999, 3.5100019999999996]}}, {"layer": "F", "center": [103.5, 94.475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.05684699999999, 95.031847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.943153, 93.91815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D37", "bbox": {"pos": [101.870222, 92.84522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [103.5, 91.545], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.05684699999999, 92.10184699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.943153, 90.988153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D36", "bbox": {"pos": [101.870222, 89.915222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [103.5, 88.615], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.05684699999999, 89.171847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.943153, 88.05815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D35", "bbox": {"pos": [101.870222, 86.985222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [103.44999999999999, 85.685], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.006847, 86.24184699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.893153, 85.128153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D34", "bbox": {"pos": [101.820222, 84.055222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [103.44999999999999, 82.755], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.006847, 83.311847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.893153, 82.19815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D33", "bbox": {"pos": [101.820222, 81.125222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [103.44999999999999, 79.825], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [104.006847, 80.381847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [102.893153, 79.268153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D32", "bbox": {"pos": [101.820222, 78.195222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.42, 94.4875], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.97684699999999, 95.044347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.863153, 93.93065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D31", "bbox": {"pos": [104.790222, 92.857722], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.42, 91.5475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.97684699999999, 92.10434699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.863153, 90.990653], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D30", "bbox": {"pos": [104.790222, 89.917722], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.42, 88.6075], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.97684699999999, 89.16434699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.863153, 88.050653], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D29", "bbox": {"pos": [104.790222, 86.977722], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.39999999999999, 85.66749999999999], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.956847, 86.224347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.843153, 85.110653], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D28", "bbox": {"pos": [104.77022199999999, 84.037722], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.39999999999999, 82.72749999999999], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.956847, 83.284347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.843153, 82.170653], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D27", "bbox": {"pos": [104.77022199999999, 81.09772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [106.39999999999999, 79.7875], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [106.956847, 80.344347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [105.843153, 79.23065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D26", "bbox": {"pos": [104.77022199999999, 78.15772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.33999999999999, 94.475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.896847, 95.031847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.783153, 93.91815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D25", "bbox": {"pos": [107.710222, 92.84522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.33999999999999, 91.5375], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.896847, 92.094347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.783153, 90.98065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D24", "bbox": {"pos": [107.710222, 89.90772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.33999999999999, 88.6], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.896847, 89.156847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.783153, 88.04315299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D23", "bbox": {"pos": [107.710222, 86.97022199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.35, 85.6625], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.906847, 86.219347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.79315299999999, 85.10565299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D22", "bbox": {"pos": [107.72022199999999, 84.03272199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.35, 82.725], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.906847, 83.281847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.79315299999999, 82.16815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D21", "bbox": {"pos": [107.72022199999999, 81.09522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [109.35, 79.7875], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [109.906847, 80.344347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [108.79315299999999, 79.23065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D20", "bbox": {"pos": [107.72022199999999, 78.15772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.25999999999999, 94.475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.816847, 95.031847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.703153, 93.91815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D19", "bbox": {"pos": [110.63022199999999, 92.84522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.25999999999999, 91.5375], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.816847, 92.094347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.703153, 90.98065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D18", "bbox": {"pos": [110.63022199999999, 89.90772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.25999999999999, 88.6], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.816847, 89.156847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.703153, 88.04315299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D17", "bbox": {"pos": [110.63022199999999, 86.97022199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.3, 85.6625], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.856847, 86.219347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.74315299999999, 85.10565299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D16", "bbox": {"pos": [110.670222, 84.03272199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.3, 82.725], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.856847, 83.281847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.74315299999999, 82.16815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D15", "bbox": {"pos": [110.670222, 81.09522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [112.3, 79.7875], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [112.856847, 80.344347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [111.74315299999999, 79.23065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D14", "bbox": {"pos": [110.670222, 78.15772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.17999999999999, 94.475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.736847, 95.031847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.62315299999999, 93.91815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D13", "bbox": {"pos": [113.55022199999999, 92.84522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.17999999999999, 91.5375], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.736847, 92.094347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.62315299999999, 90.98065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D12", "bbox": {"pos": [113.55022199999999, 89.90772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.17999999999999, 88.6], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.736847, 89.156847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.62315299999999, 88.04315299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D11", "bbox": {"pos": [113.55022199999999, 86.97022199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.25, 85.6625], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.80684699999999, 86.219347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.693153, 85.10565299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D10", "bbox": {"pos": [113.620222, 84.03272199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.25, 82.725], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.80684699999999, 83.281847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.693153, 82.16815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D9", "bbox": {"pos": [113.620222, 81.09522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [115.25, 79.7875], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [115.80684699999999, 80.344347], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [114.693153, 79.23065299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D8", "bbox": {"pos": [113.620222, 78.15772199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.1, 94.475], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.656847, 95.031847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.54315299999999, 93.91815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D7", "bbox": {"pos": [116.47022199999999, 92.84522199999999], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.1, 91.545], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.656847, 92.10184699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.54315299999999, 90.988153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D6", "bbox": {"pos": [116.47022199999999, 89.915222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.1, 88.615], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.656847, 89.171847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.54315299999999, 88.05815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D5", "bbox": {"pos": [116.47022199999999, 86.985222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.19999999999999, 85.685], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.756847, 86.24184699999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.643153, 85.128153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D4", "bbox": {"pos": [116.570222, 84.055222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.19999999999999, 82.755], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.756847, 83.311847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.643153, 82.19815299999999], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D3", "bbox": {"pos": [116.570222, 81.125222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [118.19999999999999, 79.825], "pads": [{"layers": ["F"], "angle": -315.0, "pos": [118.756847, 80.381847], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -315.0, "pos": [117.643153, 79.268153], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "D2", "bbox": {"pos": [116.570222, 78.195222], "size": [3.217485, 3.217485]}}, {"layer": "F", "center": [110.94999999999999, 101.07499999999999], "pads": [{"layers": ["F"], "angle": -180.0, "pos": [108.0, 103.35], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 102.69999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 102.05], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 101.39999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 100.75], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 100.1], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 99.44999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [108.0, 98.8], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 98.8], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 99.44999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 100.1], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 100.75], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 101.39999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 102.05], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 102.69999999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [1.5, 0.44999999999999996]}, {"layers": ["F"], "angle": -180.0, "pos": [113.89999999999999, 103.35], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [1.5, 0.44999999999999996]}], "drawings": [], "ref": "U1", "bbox": {"pos": [106.974999, 98.249999], "size": [7.950002, 5.750001999999999]}}, {"layer": "F", "center": [117.94999999999999, 101.07499999999999], "pads": [{"layers": ["F"], "angle": -90.0, "pos": [118.69999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [118.19999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [117.19999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [117.69999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [118.69999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [117.69999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [118.19999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [117.19999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.5, 0.39999999999999997]}], "drawings": [], "ref": "RN4", "bbox": {"pos": [116.674999, 100.049999], "size": [2.550002, 2.050002]}}, {"layer": "F", "center": [116.94999999999999, 109.675], "pads": [{"layers": ["F"], "angle": -270.0, "pos": [116.19999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [116.69999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [117.69999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [117.19999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [116.19999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [117.19999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [116.69999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [117.69999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.5, 0.39999999999999997]}], "drawings": [], "ref": "RN3", "bbox": {"pos": [115.674999, 108.649999], "size": [2.550002, 2.050002]}}, {"layer": "F", "center": [103.94999999999999, 101.07499999999999], "pads": [{"layers": ["F"], "angle": -90.0, "pos": [104.69999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [104.19999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [103.19999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [103.69999999999999, 100.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [104.69999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -90.0, "pos": [103.69999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [104.19999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -90.0, "pos": [103.19999999999999, 101.57499999999999], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.5, 0.39999999999999997]}], "drawings": [], "ref": "RN2", "bbox": {"pos": [102.674999, 100.049999], "size": [2.550002, 2.050002]}}, {"layer": "F", "center": [104.94999999999999, 109.675], "pads": [{"layers": ["F"], "angle": -270.0, "pos": [104.19999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [104.69999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [105.69999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [105.19999999999999, 110.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [104.19999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.39999999999999997]}, {"layers": ["F"], "angle": -270.0, "pos": [105.19999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [104.69999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "type": "smd", "size": [0.5, 0.3]}, {"layers": ["F"], "angle": -270.0, "pos": [105.69999999999999, 109.175], "shape": "rect", "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.5, 0.39999999999999997]}], "drawings": [], "ref": "RN1", "bbox": {"pos": [103.674999, 108.649999], "size": [2.550002, 2.050002]}}, {"layer": "F", "center": [110.925, 98.8586], "pads": [{"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 82.34859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 84.8886], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 87.4286], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 89.9686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 92.5086], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 95.0486], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 97.5886], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 100.12859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 102.6686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 105.20859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 107.7486], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 110.28859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 112.8286], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 115.3686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 79.8086], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "pin1": 1, "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [100.765, 117.90859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 89.9686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 92.5086], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 95.0486], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 97.5886], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 100.12859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 102.6686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 105.20859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 107.7486], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 110.28859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 112.8286], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 115.3686], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [121.085, 117.90859999999999], "drillsize": [1.0, 1.0], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [1.7, 1.7]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [119.815, 75.9986], "drillsize": [2.54, 2.54], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [3.556, 3.556]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [119.815, 121.7186], "drillsize": [2.54, 2.54], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [3.556, 3.556]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [102.035, 75.9986], "drillsize": [2.54, 2.54], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [3.556, 3.556]}, {"layers": ["F", "B"], "angle": -270.0, "pos": [102.035, 121.7186], "drillsize": [2.54, 2.54], "shape": "circle", "offset": [0.0, 0.0], "drillshape": "circle", "type": "th", "size": [3.556, 3.556]}], "drawings": [], "ref": "J1", "bbox": {"pos": [99.469999, 73.83999899999999], "size": [22.910002, 50.037202]}}, {"layer": "F", "center": [113.1, 104.75], "pads": [{"layers": ["F"], "angle": -180.0, "pos": [112.3125, 104.75], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "type": "smd", "size": [0.875, 0.95]}, {"layers": ["F"], "angle": -180.0, "pos": [113.88749999999999, 104.75], "shape": "roundrect", "radius": 0.21875, "offset": [0.0, 0.0], "pin1": 1, "type": "smd", "size": [0.875, 0.95]}], "drawings": [], "ref": "C1", "bbox": {"pos": [111.594999, 103.99499899999999], "size": [3.010002, 1.5100019999999998]}}], "edges": [{"width": 0.049999999999999996, "endangle": 360.0, "start": [119.815, 76.405], "radius": 2.54, "startangle": 270.0, "type": "arc"}, {"width": 0.049999999999999996, "endangle": 270.0, "start": [102.035, 76.405], "radius": 2.54, "startangle": 180.0, "type": "arc"}, {"width": 0.049999999999999996, "endangle": 180.0, "start": [102.035, 121.31219999999999], "radius": 2.54, "startangle": 91.10000000000001, "type": "arc"}, {"width": 0.049999999999999996, "endangle": 90.0, "start": [119.815, 121.31219999999999], "radius": 2.54, "startangle": 0.0, "type": "arc"}, {"start": [119.815, 73.865], "end": [102.035, 73.865], "type": "segment", "width": 0.049999999999999996}, {"start": [99.49499999999999, 76.405], "end": [99.49499999999999, 121.31219999999999], "type": "segment", "width": 0.049999999999999996}, {"start": [101.986238, 123.851732], "end": [119.815, 123.8522], "type": "segment", "width": 0.049999999999999996}, {"start": [122.35499999999999, 121.31219999999999], "end": [122.35499999999999, 76.405], "type": "segment", "width": 0.049999999999999996}], "bom": {"both": [[1, "100n", "C_0603_1608Metric", [["C1", 50]], []], [36, "LED", "LED_0603_1608Metric_45_noSilk", [["D2", 43], ["D3", 42], ["D4", 41], ["D5", 40], ["D6", 39], ["D7", 38], ["D8", 37], ["D9", 36], ["D10", 35], ["D11", 34], ["D12", 33], ["D13", 32], ["D14", 31], ["D15", 30], ["D16", 29], ["D17", 28], ["D18", 27], ["D19", 26], ["D20", 25], ["D21", 24], ["D22", 23], ["D23", 22], ["D24", 21], ["D25", 20], ["D26", 19], ["D27", 18], ["D28", 17], ["D29", 16], ["D30", 15], ["D31", 14], ["D32", 13], ["D33", 12], ["D34", 11], ["D35", 10], ["D36", 9], ["D37", 8]], []], [1, "LED_RGBA", "LED_ARGB_PLCC4_1210", [["D1", 0]], []], [1, "CD74HC4050", "TSSOP-16_4.4x5mm_P0.65mm", [["U1", 44]], []], [4, "SW_Push", "BT_PTS815", [["SW1", 7], ["SW2", 6], ["SW3", 5], ["SW4", 4]], []], [1, "LOGO", "OSHW_Logo_3.6x3.6_F.Mask", [["G***", 1]], []], [3, "330R", "R_Array_Convex_4x0402", [["RN2", 47], ["RN3", 46], ["RN4", 45]], []], [1, "10K", "R_Array_Convex_4x0402", [["RN1", 48]], []], [1, "Josh Details", "josh-details", [["REF**", 3]], []], [1, "Feather", "featherwing", [["J1", 49]], []]], "B": [[1, "LOGO", "OSHW_Logo_3.6x3.6_F.Mask", [["G***", 1]], []], [1, "Josh Details", "josh-details", [["REF**", 3]], []]], "F": [[1, "100n", "C_0603_1608Metric", [["C1", 50]], []], [36, "LED", "LED_0603_1608Metric_45_noSilk", [["D2", 43], ["D3", 42], ["D4", 41], ["D5", 40], ["D6", 39], ["D7", 38], ["D8", 37], ["D9", 36], ["D10", 35], ["D11", 34], ["D12", 33], ["D13", 32], ["D14", 31], ["D15", 30], ["D16", 29], ["D17", 28], ["D18", 27], ["D19", 26], ["D20", 25], ["D21", 24], ["D22", 23], ["D23", 22], ["D24", 21], ["D25", 20], ["D26", 19], ["D27", 18], ["D28", 17], ["D29", 16], ["D30", 15], ["D31", 14], ["D32", 13], ["D33", 12], ["D34", 11], ["D35", 10], ["D36", 9], ["D37", 8]], []], [1, "LED_RGBA", "LED_ARGB_PLCC4_1210", [["D1", 0]], []], [1, "CD74HC4050", "TSSOP-16_4.4x5mm_P0.65mm", [["U1", 44]], []], [4, "SW_Push", "BT_PTS815", [["SW1", 7], ["SW2", 6], ["SW3", 5], ["SW4", 4]], []], [3, "330R", "R_Array_Convex_4x0402", [["RN2", 47], ["RN3", 46], ["RN4", 45]], []], [1, "10K", "R_Array_Convex_4x0402", [["RN1", 48]], []], [1, "Feather", "featherwing", [["J1", 49]], []]]}, "silkscreen": {"B": [{"angle": [270.0], "type": "polygon", "pos": [104.6, 109.8], "polygons": [[[5.8474639999999996, -0.05715], [5.849006, -0.387052], [5.850566, -0.6699809999999999], [5.8522609999999995, -0.9097609999999999], [5.854208, -1.1102189999999998], [5.856523, -1.275181], [5.859322, -1.408472], [5.862724, -1.5139179999999999], [5.8668439999999995, -1.595345], [5.871798999999999, -1.65658], [5.877707, -1.701447], [5.884683, -1.733774], [5.8928449999999994, -1.757385], [5.899801999999999, -1.77165], [5.944903999999999, -1.8541999999999998], [5.1308, -1.8541999999999998], [5.1308, -1.778], [5.127441, -1.7244519999999999], [5.119351, -1.7018039999999999], [5.1192269999999995, -1.7018], [5.093109, -1.7147839999999999], [5.040725999999999, -1.747537], [5.013903, -1.765421], [4.881603, -1.832647], [4.721937, -1.879589], [4.5530219999999995, -1.903338], [4.392977, -1.900984], [4.2926, -1.881247], [4.108538, -1.799939], [3.9434099999999996, -1.6782], [3.8085169999999997, -1.52551], [3.747155, -1.423694], [3.679731, -1.2660289999999998], [3.635855, -1.099951], [3.612714, -0.911403], [3.6072409999999997, -0.7249129999999999], [3.608002, -0.7111999999999999], [4.408136, -0.7111999999999999], [4.412634, -0.886895], [4.426248999999999, -1.020414], [4.451477, -1.1199489999999999], [4.490812, -1.1936909999999998], [4.5467509999999995, -1.249831], [4.579016, -1.27217], [4.685421, -1.3101639999999999], [4.811144, -1.307176], [4.946203, -1.263728], [4.970498999999999, -1.251773], [5.0672999999999995, -1.201557], [5.074142, -0.6524869999999999], [5.080985, -0.103416], [5.013891, -0.059454], [4.95036, -0.032707], [4.8606679999999995, -0.012044], [4.802633, -0.005065], [4.714255, -0.00197], [4.655291, -0.012095], [4.604985, -0.040683], [4.578927, -0.061568], [4.511583, -0.13516699999999998], [4.462664, -0.230737], [4.430340999999999, -0.355234], [4.412787, -0.5156109999999999], [4.408136, -0.7111999999999999], [3.608002, -0.7111999999999999], [3.623675, -0.428965], [3.6715419999999996, -0.16913399999999998], [3.750171, 0.053491], [3.858889, 0.23781999999999998], [3.997025, 0.38276299999999996], [4.163906, 0.487232], [4.35886, 0.550136], [4.3981699999999995, 0.557165], [4.513703, 0.565425], [4.641063, 0.5585709999999999], [4.7676609999999995, 0.539148], [4.8809119999999995, 0.509701], [4.968228, 0.472775], [5.016261999999999, 0.432185], [5.037127, 0.40771799999999997], [5.05317, 0.412808], [5.064925, 0.451343], [5.0729239999999995, 0.527212], [5.0777019999999995, 0.644299], [5.079793, 0.8064939999999999], [5.08, 0.89633], [5.079477, 1.070427], [5.077469, 1.201783], [5.0733109999999995, 1.2984499999999999], [5.066343, 1.3684809999999998], [5.0559009999999995, 1.419927], [5.041322, 1.460842], [5.031937999999999, 1.48053], [4.9838759999999995, 1.5748], [5.840228, 1.5748], [5.8474639999999996, -0.05715]]]}, {"angle": [270.0], "type": "polygon", "pos": [104.6, 109.8], "polygons": [[[2.62762, 0.5476409999999999], [2.803576, 0.507736], [2.922513, 0.463105], [3.015098, 0.407222], [3.097779, 0.33364], [3.1509169999999997, 0.278812], [3.194396, 0.22717099999999998], [3.229291, 0.173008], [3.2566759999999997, 0.11061299999999999], [3.277624, 0.034277], [3.293209, -0.061709999999999994], [3.3045039999999997, -0.183058], [3.312585, -0.33547499999999997], [3.318523, -0.52467], [3.323394, -0.756355], [3.3255489999999996, -0.877477], [3.3298069999999997, -1.109434], [3.33393, -1.2960509999999998], [3.338276, -1.442785], [3.343203, -1.555095], [3.349068, -1.638437], [3.3562309999999997, -1.698269], [3.365049, -1.740049], [3.37588, -1.769234], [3.385135, -1.7855269999999999], [3.4301709999999996, -1.8541999999999998], [2.619418, -1.8541999999999998], [2.6035, -1.7006979999999998], [2.504102, -1.768483], [2.347946, -1.847254], [2.167092, -1.8931779999999998], [1.9772949999999998, -1.904137], [1.794309, -1.8780109999999999], [1.760834, -1.868436], [1.5744289999999999, -1.786112], [1.42352, -1.668585], [1.310652, -1.519321], [1.238375, -1.341786], [1.2092349999999998, -1.139443], [1.208788, -1.1176], [1.209452, -1.0885449999999999], [1.9377069999999998, -1.0885449999999999], [1.9419629999999999, -1.177884], [1.9520899999999999, -1.208502], [2.014779, -1.289089], [2.109723, -1.343481], [2.223327, -1.367352], [2.341996, -1.3563779999999999], [2.379596, -1.344508], [2.466783, -1.302968], [2.522424, -1.2503659999999999], [2.5528939999999998, -1.1752799999999999], [2.5645659999999997, -1.066289], [2.5654, -1.011572], [2.5654, -0.8128], [2.3994839999999997, -0.8128], [2.235747, -0.827824], [2.097128, -0.870733], [2.001676, -0.9315549999999999], [1.959069, -0.9982979999999999], [1.9377069999999998, -1.0885449999999999], [1.209452, -1.0885449999999999], [1.211403, -1.0032729999999999], [1.225051, -0.915974], [1.25455, -0.8323109999999999], [1.277882, -0.782215], [1.382223, -0.625636], [1.5266039999999998, -0.499758], [1.710369, -0.40487799999999996], [1.9328619999999999, -0.341291], [2.193426, -0.309295], [2.3337939999999997, -0.305241], [2.572088, -0.30479999999999996], [2.5581959999999997, -0.201228], [2.522262, -0.08796], [2.450344, -0.009507], [2.343724, 0.033837], [2.203687, 0.041776999999999995], [2.031516, 0.01402], [1.854509, -0.040144], [1.7700509999999998, -0.067413], [1.705058, -0.082373], [1.673195, -0.081908], [1.6728619999999998, -0.081589], [1.655276, -0.049872], [1.6251799999999998, 0.016087999999999998], [1.587902, 0.103255], [1.548773, 0.198596], [1.5131219999999999, 0.28907499999999997], [1.4862799999999998, 0.36166], [1.4735749999999999, 0.403315], [1.4731999999999998, 0.406698], [1.49499, 0.42538299999999996], [1.538447, 0.43179999999999996], [1.590031, 0.437963], [1.67685, 0.454576], [1.7851029999999999, 0.478825], [1.8622969999999999, 0.49782699999999996], [2.1280959999999998, 0.54864], [2.386776, 0.565282], [2.62762, 0.5476409999999999]]]}, {"angle": [270.0], "type": "polygon", "pos": [104.6, 109.8], "polygons": [[[0.5446759999999999, 1.393659], [0.585911, 1.383857], [0.656879, 1.361171], [0.752173, 1.325037], [0.859521, 1.280813], [0.966653, 1.2338529999999999], [1.0612979999999999, 1.189513], [1.1311849999999999, 1.153149], [1.162064, 1.132402], [1.152374, 1.109418], [1.120036, 1.054492], [1.071464, 0.9773489999999999], [1.013074, 0.887712], [0.9512809999999999, 0.7953049999999999], [0.8925019999999999, 0.709849], [0.843152, 0.6410699999999999], [0.810677, 0.599841], [0.7822359999999999, 0.602376], [0.730081, 0.6326649999999999], [0.686407, 0.666688], [0.541298, 0.758774], [0.37648699999999996, 0.804441], [0.218098, 0.805716], [0.047397999999999996, 0.765098], [-0.096741, 0.681873], [-0.213755, 0.557075], [-0.303081, 0.39174], [-0.364157, 0.18690299999999999], [-0.39641899999999997, -0.056401], [-0.399574, -0.3302], [-0.378133, -0.577826], [-0.333016, -0.7837409999999999], [-0.26237, -0.952105], [-0.164343, -1.08708], [-0.037083, -1.192826], [-0.007421, -1.2111509999999999], [0.069773, -1.251415], [0.141238, -1.272876], [0.22902699999999998, -1.280676], [0.29209999999999997, -1.2810089999999998], [0.45181699999999997, -1.2653539999999999], [0.5905469999999999, -1.217392], [0.724625, -1.1306129999999999], [0.7748459999999999, -1.088663], [0.8290919999999999, -1.044162], [0.8654139999999999, -1.020225], [0.8730549999999999, -1.018969], [0.895216, -1.052288], [0.9344979999999999, -1.116333], [0.9852299999999999, -1.2013479999999999], [1.0417429999999999, -1.297575], [1.098366, -1.395257], [1.1494309999999999, -1.4846359999999998], [1.189265, -1.555956], [1.2122009999999999, -1.5994599999999999], [1.215453, -1.60818], [1.190218, -1.621554], [1.132344, -1.652253], [1.054062, -1.693786], [1.0494569999999999, -1.69623], [0.8871469999999999, -1.7766119999999999], [0.744212, -1.831928], [0.6022719999999999, -1.8669859999999998], [0.442947, -1.886593], [0.29209999999999997, -1.89434], [0.099285, -1.8955689999999998], [-0.05275, -1.886113], [-0.143564, -1.8705649999999998], [-0.375799, -1.785718], [-0.588841, -1.656718], [-0.7786339999999999, -1.487906], [-0.9411219999999999, -1.283623], [-1.0722479999999999, -1.048209], [-1.167956, -0.786005], [-1.172452, -0.769632], [-1.20875, -0.5830259999999999], [-1.227655, -0.36891999999999997], [-1.229177, -0.145257], [-1.213331, 0.070018], [-1.1801279999999998, 0.25895999999999997], [-1.171703, 0.290956], [-1.069939, 0.564565], [-0.927268, 0.8105319999999999], [-0.746196, 1.025347], [-0.52923, 1.205505], [-0.508, 1.2199179999999998], [-0.330356, 1.3124959999999999], [-0.122302, 1.378252], [0.102198, 1.415093], [0.32917799999999997, 1.4209269999999998], [0.5446759999999999, 1.393659]]]}, {"angle": [270.0], "type": "polygon", "pos": [104.6, 109.8], "polygons": [[[-1.5486369999999998, 1.957301], [-1.526845, 1.950024], [-1.508414, 1.9335799999999999], [-1.4930649999999999, 1.904803], [-1.480519, 1.860526], [-1.4704949999999999, 1.797582], [-1.4627169999999998, 1.7128059999999998], [-1.456904, 1.603029], [-1.452777, 1.4650859999999999], [-1.450057, 1.295809], [-1.448465, 1.092032], [-1.4477229999999999, 0.8505889999999999], [-1.44755, 0.568313], [-1.447668, 0.242036], [-1.447797, -0.131407], [-1.4478, -0.1905], [-1.447878, -0.5658839999999999], [-1.448151, -0.8937109999999999], [-1.448682, -1.1772209999999999], [-1.449531, -1.4196579999999999], [-1.4507599999999998, -1.624261], [-1.452431, -1.794274], [-1.454605, -1.932939], [-1.4573429999999998, -2.0434959999999998], [-1.460708, -2.129188], [-1.464759, -2.193257], [-1.4695589999999998, -2.238944], [-1.475169, -2.269492], [-1.4816509999999998, -2.288141], [-1.487715, -2.296885], [-1.498791, -2.303992], [-1.518999, -2.310213], [-1.55151, -2.315606], [-1.599497, -2.320229], [-1.6661329999999999, -2.32414], [-1.7545899999999999, -2.327396], [-1.86804, -2.330056], [-2.009656, -2.332175], [-2.18261, -2.3338129999999997], [-2.390076, -2.335028], [-2.635224, -2.335876], [-2.921229, -2.3364149999999997], [-3.251261, -2.336703], [-3.628495, -2.336798], [-3.683001, -2.3367999999999998], [-4.0668239999999996, -2.336726], [-4.40302, -2.336467], [-4.694761, -2.335965], [-4.945219, -2.335162], [-5.1575679999999995, -2.334], [-5.334979, -2.3324219999999998], [-5.480625, -2.330371], [-5.597678, -2.327787], [-5.689312, -2.324615], [-5.758697, -2.320795], [-5.8090079999999995, -2.316271], [-5.8434159999999995, -2.310985], [-5.865093, -2.3048789999999997], [-5.877212999999999, -2.297895], [-5.878286, -2.296885], [-5.885535, -2.285627], [-5.891862, -2.265152], [-5.897328, -2.2322189999999997], [-5.901993999999999, -2.183586], [-5.9059219999999994, -2.116011], [-5.909174, -2.026252], [-5.91181, -1.911068], [-5.913893, -1.7672169999999998], [-5.915483, -1.591456], [-5.9166419999999995, -1.380544], [-5.917432, -1.1312389999999999], [-5.917914, -0.8402999999999999], [-5.918149, -0.5044839999999999], [-5.9182, -0.1905], [-5.918123, 0.184885], [-5.91785, 0.512712], [-5.917319, 0.796222], [-5.9164699999999995, 1.038659], [-5.915241, 1.2432619999999999], [-5.914052, 1.364271], [-5.638801, 1.364271], [-5.628362999999999, 1.339362], [-5.602056, 1.285156], [-5.588000999999999, 1.257301], [-5.577068, 1.234226], [-5.567826, 1.20858], [-5.5601329999999995, 1.1761409999999999], [-5.5538479999999995, 1.132692], [-5.548827999999999, 1.074012], [-5.544931999999999, 0.995883], [-5.5420169999999995, 0.894083], [-5.539943, 0.7643949999999999], [-5.538565999999999, 0.602599], [-5.537745999999999, 0.404475], [-5.537341, 0.165803], [-5.537209, -0.11763499999999999], [-5.537201, -0.25429], [-5.537561, -0.517726], [-5.5385979999999995, -0.766037], [-5.5402439999999995, -0.994556], [-5.542432, -1.198618], [-5.545097, -1.3735579999999998], [-5.54817, -1.514711], [-5.551584999999999, -1.61741], [-5.555276, -1.676991], [-5.557776, -1.69037], [-5.582199999999999, -1.730136], [-5.608032, -1.7843499999999999], [-5.6377109999999995, -1.8541999999999998], [-5.111206, -1.8538109999999999], [-4.956033, -1.852849], [-4.82165, -1.8503809999999998], [-4.715001, -1.846674], [-4.6430299999999995, -1.8419919999999999], [-4.612680999999999, -1.8366], [-4.612906, -1.8347609999999999], [-4.642855, -1.8008259999999998], [-4.678668, -1.742626], [-4.6827559999999995, -1.7348109999999999], [-4.6976819999999995, -1.6975209999999998], [-4.708692999999999, -1.6472669999999998], [-4.716330999999999, -1.5765559999999998], [-4.721134, -1.477898], [-4.723644, -1.3437999999999999], [-4.724399, -1.166772], [-4.7244, -1.156961], [-4.723167, -0.979347], [-4.7196039999999995, -0.836876], [-4.713922, -0.733727], [-4.706328, -0.674078], [-4.699586, -0.6604], [-4.6700859999999995, -0.67977], [-4.632359, -0.726744], [-4.630085, -0.73025], [-4.589507, -0.787268], [-4.555301, -0.8255], [-4.524853, -0.862632], [-4.484916999999999, -0.924966], [-4.471329, -0.9488329999999999], [-4.42918, -1.01593], [-4.366473, -1.10472], [-4.295408, -1.198064], [-4.281458, -1.215533], [-4.1733389999999995, -1.358344], [-4.0828619999999995, -1.494967], [-4.0146109999999995, -1.617349], [-3.973169, -1.7174399999999999], [-3.9623999999999997, -1.775923], [-3.9623999999999997, -1.8541999999999998], [-2.8359449999999997, -1.8541999999999998], [-2.848071, -1.840488], [-2.6923999999999997, -1.840488], [-2.668301, -1.844757], [-2.601204, -1.848485], [-2.498911, -1.851448], [-2.3692219999999997, -1.853426], [-2.219939, -1.854196], [-2.2098, -1.8541999999999998], [-2.033033, -1.853408], [-1.901899, -1.850806], [-1.811253, -1.846056], [-1.75595, -1.8388179999999998], [-1.7308439999999998, -1.828752], [-1.728008, -1.82245], [-1.742962, -1.778554], [-1.766108, -1.741395], [-1.775302, -1.722692], [-1.7828979999999999, -1.690195], [-1.7890409999999999, -1.639498], [-1.7938729999999998, -1.566196], [-1.797536, -1.4658829999999998], [-1.800174, -1.3341539999999998], [-1.8019299999999998, -1.166604], [-1.8029469999999999, -0.958827], [-1.803367, -0.706418], [-1.8034, -0.5920449999999999], [-1.8034, 0.508], [-2.6683049999999997, 0.508], [-2.629553, 0.433062], [-2.619522, 0.40718499999999996], [-2.6113329999999997, 0.36890799999999996], [-2.604808, 0.313393], [-2.599774, 0.23580299999999998], [-2.596053, 0.1313], [-2.593471, -0.004954], [-2.591852, -0.17779699999999998], [-2.591021, -0.392067], [-2.5907999999999998, -0.6347499999999999], [-2.5909139999999997, -0.88644], [-2.591415, -1.092511], [-2.592545, -1.258147], [-2.594545, -1.3885269999999998], [-2.597655, -1.488835], [-2.602117, -1.5642509999999998], [-2.608171, -1.6199569999999999], [-2.616059, -1.661135], [-2.6260209999999997, -1.6929669999999999], [-2.638299, -1.720635], [-2.6416, -1.7271999999999998], [-2.67251, -1.790636], [-2.69052, -1.83311], [-2.6923999999999997, -1.840488], [-2.848071, -1.840488], [-2.897523, -1.78457], [-2.941445, -1.735266], [-2.969627, -1.7042899999999999], [-2.9718, -1.7020199999999999], [-3.0295549999999998, -1.6389049999999998], [-3.101037, -1.554689], [-3.176103, -1.462065], [-3.2446089999999996, -1.3737249999999999], [-3.2964119999999997, -1.3023609999999999], [-3.316624, -1.2705469999999999], [-3.356845, -1.2065839999999999], [-3.4203379999999997, -1.115299], [-3.4981959999999996, -1.00868], [-3.5815129999999997, -0.8987149999999999], [-3.661383, -0.7973899999999999], [-3.723727, -0.722607], [-3.7841709999999997, -0.645548], [-3.8408409999999997, -0.561943], [-3.8450219999999997, -0.5550499999999999], [-3.9723629999999996, -0.356936], [-4.068006, -0.226356], [-4.137964, -0.135212], [-4.056532, -0.04776], [-3.9863399999999998, 0.031339], [-3.8962849999999998, 0.13810799999999998], [-3.7969429999999997, 0.259549], [-3.698893, 0.382661], [-3.612711, 0.49444499999999997], [-3.583849, 0.533185], [-3.2790589999999997, 0.9131079999999999], [-3.0397209999999997, 1.170213], [-2.840941, 1.3716], [-3.386253, 1.3716], [-3.57145, 1.3714769999999998], [-3.712002, 1.370139], [-3.814063, 1.366133], [-3.883788, 1.358007], [-3.9273309999999997, 1.344309], [-3.950847, 1.3235839999999999], [-3.960489, 1.294382], [-3.962414, 1.2552489999999998], [-3.9623999999999997, 1.2356099999999999], [-3.977988, 1.182158], [-4.017059, 1.114879], [-4.034701, 1.0916379999999999], [-4.093348, 1.014332], [-4.15611, 0.923414], [-4.178198, 0.889], [-4.221448, 0.822236], [-4.255088, 0.775069], [-4.266761, 0.762], [-4.296555, 0.732661], [-4.345755, 0.676982], [-4.405478, 0.605892], [-4.466838, 0.530319], [-4.5209529999999996, 0.461192], [-4.558936999999999, 0.409439], [-4.572, 0.386517], [-4.588818, 0.357026], [-4.630853999999999, 0.309283], [-4.648200999999999, 0.29209999999999997], [-4.724400999999999, 0.21909599999999999], [-4.7244, 0.6389119999999999], [-4.7228069999999995, 0.8216979999999999], [-4.717105, 0.9645239999999999], [-4.705907, 1.07816], [-4.687828, 1.173371], [-4.6614819999999995, 1.2609249999999999], [-4.635835999999999, 1.3271499999999998], [-4.632606, 1.342229], [-4.641351, 1.353462], [-4.668295, 1.3614089999999999], [-4.719662, 1.366633], [-4.801676, 1.369697], [-4.920561, 1.371162], [-5.08254, 1.3715899999999999], [-5.128083, 1.3716], [-5.282916999999999, 1.371254], [-5.418877999999999, 1.370288], [-5.528383, 1.3688099999999999], [-5.603848999999999, 1.3669289999999998], [-5.6376919999999995, 1.364755], [-5.638801, 1.364271], [-5.914052, 1.364271], [-5.91357, 1.4132749999999998], [-5.911396, 1.5519399999999999], [-5.908658, 1.662497], [-5.9052929999999995, 1.748189], [-5.901242, 1.812258], [-5.8964419999999995, 1.857945], [-5.890832, 1.888493], [-5.8843499999999995, 1.907142], [-5.878286, 1.915886], [-5.865822, 1.9240659999999998], [-5.843563, 1.9310619999999998], [-5.807809, 1.936966], [-5.754859, 1.941867], [-5.681012, 1.9458559999999998], [-5.5825689999999994, 1.9490219999999998], [-5.455826999999999, 1.9514559999999999], [-5.297086999999999, 1.9532479999999999], [-5.102647, 1.954489], [-4.868806999999999, 1.9552669999999999], [-4.591864999999999, 1.955674], [-4.268122, 1.9558], [-2.6416, 1.9558], [-2.6416, 1.8595819999999998], [-2.621521, 1.743665], [-2.568475, 1.625], [-2.493246, 1.524009], [-2.440994, 1.4797559999999998], [-2.327454, 1.4326299999999998], [-2.1965, 1.422364], [-2.062372, 1.4460819999999999], [-1.9393099999999999, 1.5009109999999999], [-1.8415519999999999, 1.583977], [-1.8261999999999998, 1.603853], [-1.779194, 1.704572], [-1.757561, 1.820123], [-1.74631, 1.955801], [-1.63697, 1.9558], [-1.6034199999999998, 1.957023], [-1.574069, 1.9585789999999998], [-1.5486369999999998, 1.957301]]]}, {"width": 1.0, "angle": 90.0, "attr": ["mirrored"], "horiz_justify": 0, "text": "github.com/joshajohnson", "thickness": 0.15, "pos": [118.582, 109.8236], "height": 1.0}, {"width": 1.0, "angle": 90.0, "attr": ["mirrored"], "horiz_justify": 0, "text": "joshajohnson.com", "thickness": 0.15, "pos": [117.05, 107.14999999999999], "height": 1.0}, {"width": 1.0, "angle": 90.0, "attr": ["mirrored"], "horiz_justify": 0, "text": "Josh Johnson", "thickness": 0.15, "pos": [115.55, 105.35], "height": 1.0}], "F": [{"width": 1.0, "angle": 0.0, "attr": [], "horiz_justify": 0, "text": "SW4", "thickness": 0.15, "pos": [110.94999999999999, 119.28739999999999], "height": 1.0}, {"width": 1.0, "angle": 0.0, "attr": [], "horiz_justify": 0, "text": "SW3", "thickness": 0.15, "pos": [116.94999999999999, 112.19999999999999], "height": 1.0}, {"width": 1.0, "angle": 0.0, "attr": [], "horiz_justify": 0, "text": "SW2", "thickness": 0.15, "pos": [104.94999999999999, 112.175], "height": 1.0}, {"width": 1.0, "angle": 0.0, "attr": [], "horiz_justify": 0, "text": "SW1", "thickness": 0.15, "pos": [110.94999999999999, 107.3], "height": 1.0}, {"start": [114.725, 103.875], "end": [108.75, 103.875], "type": "segment", "width": 0.15}, {"start": [113.14999999999999, 98.35], "end": [108.75, 98.35], "type": "segment", "width": 0.15}, {"start": [119.13, 100.82499999999999], "end": [119.13, 101.32499999999999], "type": "segment", "width": 0.12}, {"start": [116.77, 100.82499999999999], "end": [116.77, 101.32499999999999], "type": "segment", "width": 0.12}, {"start": [115.77, 109.925], "end": [115.77, 109.425], "type": "segment", "width": 0.12}, {"start": [118.13, 109.925], "end": [118.13, 109.425], "type": "segment", "width": 0.12}, {"start": [105.13, 100.82499999999999], "end": [105.13, 101.32499999999999], "type": "segment", "width": 0.12}, {"start": [102.77, 100.82499999999999], "end": [102.77, 101.32499999999999], "type": "segment", "width": 0.12}, {"start": [103.77, 109.925], "end": [103.77, 109.425], "type": "segment", "width": 0.12}, {"start": [106.13, 109.925], "end": [106.13, 109.425], "type": "segment", "width": 0.12}, {"start": [113.262779, 104.24], "end": [112.937221, 104.24], "type": "segment", "width": 0.12}, {"start": [113.262779, 105.25999999999999], "end": [112.937221, 105.25999999999999], "type": "segment", "width": 0.12}]}, "edges_bbox": {"minx": 99.469999, "miny": 73.83999899999999, "maxx": 122.380001, "maxy": 123.877201}, "metadata": {"date": "2019-07-26 12:45:32", "company": "Josh Johnson", "revision": "0", "title": "led-wing"}}
///////////////////////////////////////////////

///////////////////////////////////////////////
/* Utility functions */

var storagePrefix = 'KiCad_HTML_BOM__' + pcbdata.metadata.title + '__' +
  pcbdata.metadata.revision + '__';
var storage;

function initStorage(key) {
  try {
    window.localStorage.getItem("blank");
    storage = window.localStorage;
  } catch (e) {
    // localStorage not available
  }
  if (!storage) {
    try {
      window.sessionStorage.getItem("blank");
      storage = window.sessionStorage;
    } catch (e) {
      // sessionStorage also not available
    }
  }
}

function readStorage(key) {
  if (storage) {
    return storage.getItem(storagePrefix + '#' + key);
  } else {
    return null;
  }
}

function writeStorage(key, value) {
  if (storage) {
    storage.setItem(storagePrefix + '#' + key, value);
  }
}

function fancyDblClickHandler(el, onsingle, ondouble) {
  return function() {
    if (el.getAttribute("data-dblclick") == null) {
      el.setAttribute("data-dblclick", 1);
      setTimeout(function() {
        if (el.getAttribute("data-dblclick") == 1) {
          onsingle();
        }
        el.removeAttribute("data-dblclick");
      }, 200);
    } else {
      el.removeAttribute("data-dblclick");
      ondouble();
    }
  }
}

function smoothScrollToRow(rowid) {
  document.getElementById(rowid).scrollIntoView({
    behavior: "smooth",
    block: "center",
    inline: "nearest"
  });
}

function focusInputField(input) {
  input.scrollIntoView(false);
  input.focus();
  input.select();
}

function copyToClipboard() {
  var text = '';
  for (var node of bomhead.childNodes[0].childNodes) {
    if (node.firstChild) {
      text = text + node.firstChild.nodeValue;
    }
    if (node != bomhead.childNodes[0].lastChild) {
      text += '\t';
    }
  }
  text += '\n';
  for (var row of bombody.childNodes) {
    for (var cell of row.childNodes) {
      for (var node of cell.childNodes) {
        if (node.nodeName == "INPUT") {
          if (node.checked) {
            text = text + '✓';
          }
        } else if (node.nodeName == "MARK") {
          text = text + node.firstChild.nodeValue;
        } else {
          text = text + node.nodeValue;
        }
      }
      if (cell != row.lastChild) {
        text += '\t';
      }
    }
    text += '\n';
  }
  var textArea = document.createElement("textarea");
  textArea.classList.add('clipboard-temp');
  textArea.value = text;

  document.body.appendChild(textArea);
  textArea.focus();
  textArea.select();

  try {
    if (document.execCommand('copy')) {
      console.log('Bom copied to clipboard.');
    }
  } catch (err) {
    console.log('Can not copy to clipboard.');
  }

  document.body.removeChild(textArea);
}

function removeGutterNode(node) {
  for (var i = 0; i < node.childNodes.length; i++) {
    if (node.childNodes[i].classList &&
      node.childNodes[i].classList.contains("gutter")) {
      node.removeChild(node.childNodes[i]);
      break;
    }
  }
}

function cleanGutters() {
  removeGutterNode(document.getElementById("bot"));
  removeGutterNode(document.getElementById("canvasdiv"));
}

var units = {
  prefixes: {
    giga: ["G", "g", "giga", "Giga", "GIGA"],
    mega: ["M", "mega", "Mega", "MEGA"],
    kilo: ["K", "k", "kilo", "Kilo", "KILO"],
    milli: ["m", "milli", "Milli", "MILLI"],
    micro: ["U", "u", "micro", "Micro", "MICRO", "μ", "µ"], // different utf8 μ
    nano: ["N", "n", "nano", "Nano", "NANO"],
    pico: ["P", "p", "pico", "Pico", "PICO"],
  },
  unitsShort: ["R", "r", "Ω", "F", "f", "H", "h"],
  unitsLong: [
    "OHM", "Ohm", "ohm", "ohms",
    "FARAD", "Farad", "farad",
    "HENRY", "Henry", "henry"
  ],
  getMultiplier: function(s) {
    if (this.prefixes.giga.includes(s)) return 1e9;
    if (this.prefixes.mega.includes(s)) return 1e6;
    if (this.prefixes.kilo.includes(s)) return 1e3;
    if (this.prefixes.milli.includes(s)) return 1e-3;
    if (this.prefixes.micro.includes(s)) return 1e-6;
    if (this.prefixes.nano.includes(s)) return 1e-9;
    if (this.prefixes.pico.includes(s)) return 1e-12;
    return 1;
  },
  valueRegex: null,
}

function initUtils() {
  var allPrefixes = units.prefixes.giga
                    .concat(units.prefixes.mega)
                    .concat(units.prefixes.kilo)
                    .concat(units.prefixes.milli)
                    .concat(units.prefixes.micro)
                    .concat(units.prefixes.nano)
                    .concat(units.prefixes.pico);
  var allUnits = units.unitsShort.concat(units.unitsLong);
  units.valueRegex = new RegExp("^([0-9\.]+)" +
                         "\\s*(" + allPrefixes.join("|") + ")?" +
                         "(" + allUnits.join("|") + ")?" +
                         "(\\b.*)?$", "");
  units.valueAltRegex = new RegExp("^([0-9]*)" +
                         "(" + units.unitsShort.join("|") + ")?" +
                         "([GgMmKkUuNnPp])?" +
                         "([0-9]*)" +
                         "(\\b.*)?$", "");
  for (var bomtable of Object.values(pcbdata.bom)) {
    for (var row of bomtable) {
      row.push(parseValue(row[1], row[3][0][0]));
    }
  }
}

function parseValue(val, ref) {
  var inferUnit = (unit, ref) => {
    if (unit) {
      unit = unit.toLowerCase();
      if (unit == 'Ω' || unit == "ohm" || unit == "ohms") {
        unit = 'r';
      }
      unit = unit[0];
    } else {
      ref = /^([a-z]+)\d+$/i.exec(ref);
      if (ref) {
        ref = ref[1].toLowerCase();
        if (ref == "c") unit = 'f';
        else if (ref == "l") unit = 'h';
        else if (ref == "r" || ref == "rv") unit = 'r';
        else unit = null;
      }
    }
    return unit;
  };
  val = val.replace(/,/g, "");
  var match = units.valueRegex.exec(val);
  var unit;
  if (match) {
    val = parseFloat(match[1]);
    if (match[2]) {
      val = val * units.getMultiplier(match[2]);
    }
    unit = inferUnit(match[3], ref);
    if (!unit) return null;
    else return {
      val: val,
      unit: unit,
      extra: match[4],
    }
  }
  match = units.valueAltRegex.exec(val);
  if (match && (match[1] || match[4])) {
    val = parseFloat(match[1] + "." + match[4]);
    if (match[3]) {
      val = val * units.getMultiplier(match[3]);
    }
    unit = inferUnit(match[2], ref);
    if (!unit) return null;
    else return {
      val: val,
      unit: unit,
      extra: match[5],
    }
  }
  return null;
}

function valueCompare(a, b, stra, strb) {
  if (a === null && b === null) {
    // Failed to parse both values, compare them as strings.
    if (stra != strb) return stra > strb ? 1 : -1;
    else return 0;
  } else if (a === null) {
    return 1;
  } else if (b === null) {
    return -1;
  } else {
    if (a.unit != b.unit) return a.unit > b.unit ? 1 : -1;
    else if (a.val != b.val) return a.val > b.val ? 1 : -1;
    else if (a.extra != b.extra) return a.extra > b.extra ? 1 : -1;
    else return 0;
  }
}

///////////////////////////////////////////////

///////////////////////////////////////////////
/* PCB rendering code */

var redrawOnDrag = true;
var boardRotation = 0;

function deg2rad(deg) {
  return deg * Math.PI / 180;
}

function calcFontPoint(linepoint, text, offsetx, offsety, tilt) {
  var point = [
    linepoint[0] * text.width + offsetx,
    linepoint[1] * text.height + offsety
  ];
  // Adding half a line height here is technically a bug
  // but pcbnew currently does the same, text is slightly shifted.
  point[0] -= (point[1] + text.height * 0.5) * tilt;
  return point;
}

function drawtext(ctx, text, color, flip) {
  ctx.save();
  ctx.translate(...text.pos);
  var angle = -text.angle;
  if (text.attr.includes("mirrored")) {
    ctx.scale(-1, 1);
    angle = -angle;
  }
  var tilt = 0;
  if (text.attr.includes("italic")) {
    tilt = 0.125;
  }
  var interline = (text.height * 1.5 + text.thickness) / 2;
  var txt = text.text.split("\n");
  // KiCad ignores last empty line.
  if (txt[txt.length-1] == '') txt.pop();
  ctx.rotate(deg2rad(angle));
  ctx.fillStyle = color;
  ctx.strokeStyle = color;
  ctx.lineCap = "round";
  ctx.lineWidth = text.thickness;
  for (var i in txt) {
    var offsety = (-(txt.length - 1) + i * 2) * interline + text.height / 2;
    var lineWidth = 0;
    for (var c of txt[i]) {
      lineWidth += pcbdata.font_data[c].w * text.width;
    }
    var offsetx = 0;
    switch (text.horiz_justify) {
      case -1:
        // Justify left, do nothing
        break;
      case 0:
        // Justify center
        offsetx -= lineWidth / 2;
        break;
      case 1:
        // Justify right
        offsetx -= lineWidth;
        break;
    }
    for (var c of txt[i]) {
      for (var line of pcbdata.font_data[c].l) {
        // Drawing each segment separately instead of
        // polyline because round line caps don't work in joints
        for (var i = 0; i < line.length - 1; i++) {
          ctx.beginPath();
          ctx.moveTo(...calcFontPoint(line[i], text, offsetx, offsety, tilt));
          ctx.lineTo(...calcFontPoint(line[i + 1], text, offsetx, offsety, tilt));
          ctx.stroke();
        }
      }
      offsetx += pcbdata.font_data[c].w * text.width;
    }
  }
  ctx.restore();
}

function drawedge(ctx, scalefactor, edge, color) {
  ctx.strokeStyle = color;
  ctx.lineWidth = Math.max(1 / scalefactor, edge.width);
  ctx.lineCap = "round";
  if (edge.type == "segment") {
    ctx.beginPath();
    ctx.moveTo(...edge.start);
    ctx.lineTo(...edge.end);
    ctx.stroke();
  }
  if (edge.type == "arc") {
    ctx.beginPath();
    ctx.arc(
      ...edge.start,
      edge.radius,
      deg2rad(edge.startangle),
      deg2rad(edge.endangle));
    ctx.stroke();
  }
  if (edge.type == "circle") {
    ctx.beginPath();
    ctx.arc(
      ...edge.start,
      edge.radius,
      0, 2 * Math.PI);
    ctx.closePath();
    ctx.stroke();
  }
}

function drawRoundRect(ctx, color, size, radius, ctxmethod) {
  ctx.beginPath();
  ctx.strokeStyle = color;
  var x = size[0] * -0.5;
  var y = size[1] * -0.5;
  var width = size[0];
  var height = size[1];
  ctx.moveTo(x, 0);
  ctx.arcTo(x, y + height, x + width, y + height, radius);
  ctx.arcTo(x + width, y + height, x + width, y, radius);
  ctx.arcTo(x + width, y, x, y, radius);
  ctx.arcTo(x, y, x, y + height, radius);
  ctx.closePath();
  ctxmethod();
}

function drawOblong(ctx, color, size, ctxmethod) {
  drawRoundRect(ctx, color, size, Math.min(size[0], size[1]) / 2, ctxmethod);
}

function drawPolygons(ctx, color, polygons, ctxmethod) {
  ctx.fillStyle = color;
  for (var polygon of polygons) {
    ctx.beginPath();
    for (var vertex of polygon) {
      ctx.lineTo(...vertex)
    }
    ctx.closePath();
    ctxmethod();
  }
}

function drawPolygonShape(ctx, shape, color) {
  ctx.save();
  ctx.translate(...shape.pos);
  ctx.rotate(deg2rad(-shape.angle));
  drawPolygons(ctx, color, shape.polygons, ctx.fill.bind(ctx));
  ctx.restore();
}

function drawDrawing(ctx, layer, scalefactor, drawing, color) {
  if (["segment", "arc", "circle"].includes(drawing.type)) {
    drawedge(ctx, scalefactor, drawing, color);
  } else if (drawing.type == "polygon") {
    drawPolygonShape(ctx, drawing, color);
  } else {
    drawtext(ctx, drawing, color, layer == "B");
  }
}

function drawCircle(ctx, radius, ctxmethod) {
  ctx.beginPath();
  ctx.arc(0, 0, radius, 0, 2 * Math.PI);
  ctx.closePath();
  ctxmethod();
}

function drawPad(ctx, pad, color, outline) {
  ctx.save();
  ctx.translate(...pad.pos);
  ctx.rotate(deg2rad(pad.angle));
  if (pad.offset) {
    ctx.translate(...pad.offset);
  }
  ctx.fillStyle = color;
  ctx.strokeStyle = color;
  var ctxmethod = outline ? ctx.stroke.bind(ctx) : ctx.fill.bind(ctx);
  if (pad.shape == "rect") {
    var rect = [...pad.size.map(c => -c * 0.5), ...pad.size];
    if (outline) {
      ctx.strokeRect(...rect);
    } else {
      ctx.fillRect(...rect);
    }
  } else if (pad.shape == "oval") {
    drawOblong(ctx, color, pad.size, ctxmethod);
  } else if (pad.shape == "circle") {
    drawCircle(ctx, pad.size[0] / 2, ctxmethod);
  } else if (pad.shape == "roundrect") {
    drawRoundRect(ctx, color, pad.size, pad.radius, ctxmethod);
  } else if (pad.shape == "custom") {
    drawPolygons(ctx, color, pad.polygons, ctxmethod);
  }
  if (pad.type == "th" && !outline) {
    ctx.fillStyle = "#CCCCCC";
    if (pad.drillshape == "oblong") {
      drawOblong(ctx, "#CCCCCC", pad.drillsize, ctxmethod);
    } else {
      drawCircle(ctx, pad.drillsize[0] / 2, ctxmethod);
    }
  }
  ctx.restore();
}

function drawModule(ctx, layer, scalefactor, module, padcolor, outlinecolor, highlight) {
  if (highlight) {
    // draw bounding box
    if (module.layer == layer) {
      ctx.save();
      ctx.globalAlpha = 0.2;
      ctx.translate(...module.bbox.pos);
      ctx.fillStyle = padcolor;
      ctx.fillRect(
        0, 0,
        ...module.bbox.size);
      ctx.globalAlpha = 1;
      ctx.strokeStyle = padcolor;
      ctx.strokeRect(
        0, 0,
        ...module.bbox.size);
      ctx.restore();
    }
  }
  // draw drawings
  for (var drawing of module.drawings) {
    if (drawing.layer == layer) {
      drawDrawing(ctx, layer, scalefactor, drawing.drawing, padcolor);
    }
  }
  // draw pads
  for (var pad of module.pads) {
    if (pad.layers.includes(layer)) {
      drawPad(ctx, pad, padcolor, false);
      if (pad.pin1 && highlightpin1) {
        drawPad(ctx, pad, outlinecolor, true);
      }
    }
  }
}

function drawEdges(canvas, scalefactor) {
  var ctx = canvas.getContext("2d");
  var edgecolor = getComputedStyle(topmostdiv).getPropertyValue('--pcb-edge-color');
  for (var edge of pcbdata.edges) {
    drawedge(ctx, scalefactor, edge, edgecolor);
  }
}

function drawModules(canvas, layer, scalefactor, highlight) {
  var ctx = canvas.getContext("2d");
  ctx.lineWidth = 3 / scalefactor;
  var style = getComputedStyle(topmostdiv);
  var padcolor = style.getPropertyValue('--pad-color');
  var outlinecolor = style.getPropertyValue('--pin1-outline-color');
  if (highlight > 0) {
    padcolor = style.getPropertyValue('--pad-color-highlight');
    outlinecolor = style.getPropertyValue('--pin1-outline-color-highlight');
  }
  for (var i = 0; i < pcbdata.modules.length; i++) {
    var mod = pcbdata.modules[i];
    if (!highlight || highlightedModules.includes(i)) {
      drawModule(ctx, layer, scalefactor, mod, padcolor, outlinecolor, highlight);
    }
  }
}

function drawSilkscreen(canvas, layer, scalefactor) {
  var ctx = canvas.getContext("2d");
  for (var d of pcbdata.silkscreen[layer]) {
    if (["segment", "arc", "circle"].includes(d.type)) {
      drawedge(ctx, scalefactor, d, "#aa4");
    } else if (d.type == "polygon") {
      drawPolygonShape(ctx, d, "#4aa");
    } else {
      drawtext(ctx, d, "#4aa", layer == "B");
    }
  }
}

function clearCanvas(canvas) {
  var ctx = canvas.getContext("2d");
  ctx.save();
  ctx.setTransform(1, 0, 0, 1, 0, 0);
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  ctx.restore();
}

function drawHighlightsOnLayer(canvasdict) {
  clearCanvas(canvasdict.highlight);
  drawModules(canvasdict.highlight, canvasdict.layer,
    canvasdict.transform.s * canvasdict.transform.zoom, true);
}

function drawHighlights() {
  drawHighlightsOnLayer(allcanvas.front);
  drawHighlightsOnLayer(allcanvas.back);
}

function drawBackground(canvasdict) {
  clearCanvas(canvasdict.bg);
  clearCanvas(canvasdict.silk);
  drawEdges(canvasdict.bg, canvasdict.transform.s);
  drawModules(canvasdict.bg, canvasdict.layer,
    canvasdict.transform.s * canvasdict.transform.zoom, false);
  drawSilkscreen(canvasdict.silk, canvasdict.layer, canvasdict.transform.s);
}

function prepareCanvas(canvas, flip, transform) {
  var ctx = canvas.getContext("2d");
  ctx.setTransform(1, 0, 0, 1, 0, 0);
  var fontsize = 1.55;
  ctx.scale(transform.zoom, transform.zoom);
  ctx.translate(transform.panx, transform.pany);
  if (flip) {
    ctx.scale(-1, 1);
  }
  ctx.translate(transform.x, transform.y);
  ctx.rotate(deg2rad(boardRotation));
  ctx.scale(transform.s, transform.s);
}

function prepareLayer(canvasdict) {
  var flip = (canvasdict.layer == "B");
  for (var c of ["bg", "silk", "highlight"]) {
    prepareCanvas(canvasdict[c], flip, canvasdict.transform);
  }
}

function rotateVector(v, angle) {
  angle = deg2rad(angle);
  return [
    v[0] * Math.cos(angle) - v[1] * Math.sin(angle),
    v[0] * Math.sin(angle) + v[1] * Math.cos(angle)
  ];
}

function applyRotation(bbox) {
  var corners = [
    [bbox.minx, bbox.miny],
    [bbox.minx, bbox.maxy],
    [bbox.maxx, bbox.miny],
    [bbox.maxx, bbox.maxy],
  ];
  corners = corners.map((v) => rotateVector(v, boardRotation));
  return {
    minx: corners.reduce((a, v) => Math.min(a, v[0]), Infinity),
    miny: corners.reduce((a, v) => Math.min(a, v[1]), Infinity),
    maxx: corners.reduce((a, v) => Math.max(a, v[0]), -Infinity),
    maxy: corners.reduce((a, v) => Math.max(a, v[1]), -Infinity),
  }
}

function recalcLayerScale(canvasdict) {
  var canvasdivid = {
    "F": "frontcanvas",
    "B": "backcanvas"
  } [canvasdict.layer];
  var width = document.getElementById(canvasdivid).clientWidth * 2;
  var height = document.getElementById(canvasdivid).clientHeight * 2;
  var bbox = applyRotation(pcbdata.edges_bbox);
  var scalefactor = 0.98 * Math.min(
    width / (bbox.maxx - bbox.minx),
    height / (bbox.maxy - bbox.miny)
  );
  if (scalefactor < 0.1) {
    scalefactor = 1;
  }
  canvasdict.transform.s = scalefactor;
  var flip = (canvasdict.layer == "B");
  if (flip) {
    canvasdict.transform.x = -((bbox.maxx + bbox.minx) * scalefactor + width) * 0.5;
  } else {
    canvasdict.transform.x = -((bbox.maxx + bbox.minx) * scalefactor - width) * 0.5;
  }
  canvasdict.transform.y = -((bbox.maxy + bbox.miny) * scalefactor - height) * 0.5;
  for (var c of ["bg", "silk", "highlight"]) {
    canvas = canvasdict[c];
    canvas.width = width;
    canvas.height = height;
    canvas.style.width = (width / 2) + "px";
    canvas.style.height = (height / 2) + "px";
  }
}

function redrawCanvas(layerdict) {
  prepareLayer(layerdict);
  drawBackground(layerdict);
  drawHighlightsOnLayer(layerdict);
}

function resizeCanvas(layerdict) {
  recalcLayerScale(layerdict);
  redrawCanvas(layerdict);
}

function resizeAll() {
  resizeCanvas(allcanvas.front);
  resizeCanvas(allcanvas.back);
}

function bboxScan(layer, x, y) {
  var result = [];
  for (var i = 0; i < pcbdata.modules.length; i++) {
    var module = pcbdata.modules[i];
    if (module.layer == layer) {
      var b = module.bbox;
      if (b.pos[0] <= x && b.pos[0] + b.size[0] >= x &&
        b.pos[1] <= y && b.pos[1] + b.size[1] >= y) {
        result.push(i);
      }
    }
  }
  return result;
}

function handleMouseDown(e, layerdict) {
  if (e.which != 1) {
    return;
  }
  e.preventDefault();
  e.stopPropagation();
  layerdict.transform.mousestartx = e.offsetX;
  layerdict.transform.mousestarty = e.offsetY;
  layerdict.transform.mousedownx = e.offsetX;
  layerdict.transform.mousedowny = e.offsetY;
  layerdict.transform.mousedown = true;
}

function handleMouseClick(e, layerdict) {
  var x = e.offsetX;
  var y = e.offsetY;
  var t = layerdict.transform;
  if (layerdict.layer == "B") {
    x = (2 * x / t.zoom - t.panx + t.x) / -t.s;
  } else {
    x = (2 * x / t.zoom - t.panx - t.x) / t.s;
  }
  y = (2 * y / t.zoom - t.y - t.pany) / t.s;
  var v = rotateVector([x, y], -boardRotation);
  var modules = bboxScan(layerdict.layer, v[0], v[1]);
  if (modules.length > 0) {
    modulesClicked(modules);
  }
}

function handleMouseUp(e, layerdict) {
  e.preventDefault();
  e.stopPropagation();
  if (e.which == 1 &&
    layerdict.transform.mousedown &&
    layerdict.transform.mousedownx == e.offsetX &&
    layerdict.transform.mousedowny == e.offsetY) {
    // This is just a click
    handleMouseClick(e, layerdict);
    layerdict.transform.mousedown = false;
    return;
  }
  if (e.which == 3) {
    // Reset pan and zoom on right click.
    layerdict.transform.panx = 0;
    layerdict.transform.pany = 0;
    layerdict.transform.zoom = 1;
    redrawCanvas(layerdict);
  } else if (!redrawOnDrag) {
    redrawCanvas(layerdict);
  }
  layerdict.transform.mousedown = false;
}

function handleMouseMove(e, layerdict) {
  if (!layerdict.transform.mousedown) {
    return;
  }
  e.preventDefault();
  e.stopPropagation();
  var dx = e.offsetX - layerdict.transform.mousestartx;
  var dy = e.offsetY - layerdict.transform.mousestarty;
  layerdict.transform.panx += 2 * dx / layerdict.transform.zoom;
  layerdict.transform.pany += 2 * dy / layerdict.transform.zoom;
  layerdict.transform.mousestartx = e.offsetX;
  layerdict.transform.mousestarty = e.offsetY;
  if (redrawOnDrag) {
    redrawCanvas(layerdict);
  }
}

function handleMouseWheel(e, layerdict) {
  e.preventDefault();
  e.stopPropagation();
  var t = layerdict.transform;
  var wheeldelta = e.deltaY;
  if (e.deltaMode == 1) {
    // FF only, scroll by lines
    wheeldelta *= 30;
  } else if (e.deltaMode == 2) {
    wheeldelta *= 300;
  }
  var m = Math.pow(1.1, -wheeldelta / 40);
  // Limit amount of zoom per tick.
  if (m > 2) {
    m = 2;
  } else if (m < 0.5) {
    m = 0.5;
  }
  t.zoom *= m;
  var zoomd = (1 - m) / t.zoom;
  t.panx += 2 * e.offsetX * zoomd;
  t.pany += 2 * e.offsetY * zoomd;
  redrawCanvas(layerdict);
}

function addMouseHandlers(div, layerdict) {
  div.onmousedown = function(e) {
    handleMouseDown(e, layerdict);
  };
  div.onmousemove = function(e) {
    handleMouseMove(e, layerdict);
  };
  div.onmouseup = function(e) {
    handleMouseUp(e, layerdict);
  };
  div.onmouseout = function(e) {
    handleMouseUp(e, layerdict);
  }
  div.onwheel = function(e) {
    handleMouseWheel(e, layerdict);
  }
  for (var element of [div, layerdict.bg, layerdict.silk, layerdict.highlight]) {
    element.addEventListener("contextmenu", function(e) {
      e.preventDefault();
    }, false);
  }
}

function setRedrawOnDrag(value) {
  redrawOnDrag = value;
  writeStorage("redrawOnDrag", value);
}

function setBoardRotation(value) {
  boardRotation = value * 5;
  writeStorage("boardRotation", boardRotation);
  document.getElementById("rotationDegree").textContent = boardRotation;
  resizeAll();
}

function initRender() {
  allcanvas = {
    front: {
      transform: {
        x: 0,
        y: 0,
        s: 1,
        panx: 0,
        pany: 0,
        zoom: 1,
        mousestartx: 0,
        mousestarty: 0,
        mousedown: false,
      },
      bg: document.getElementById("F_bg"),
      silk: document.getElementById("F_slk"),
      highlight: document.getElementById("F_hl"),
      layer: "F",
    },
    back: {
      transform: {
        x: 0,
        y: 0,
        s: 1,
        panx: 0,
        pany: 0,
        zoom: 1,
        mousestartx: 0,
        mousestarty: 0,
        mousedown: false,
      },
      bg: document.getElementById("B_bg"),
      silk: document.getElementById("B_slk"),
      highlight: document.getElementById("B_hl"),
      layer: "B",
    }
  };
  addMouseHandlers(document.getElementById("frontcanvas"), allcanvas.front);
  addMouseHandlers(document.getElementById("backcanvas"), allcanvas.back);
}

///////////////////////////////////////////////

///////////////////////////////////////////////
/* DOM manipulation and misc code */

var bomsplit;
var canvassplit;
var canvaslayout = "default";
var bomlayout = "default";
var initDone = false;
var bomSortFunction = null;
var currentSortColumn = null;
var currentSortOrder = null;
var currentHighlightedRowId;
var highlightHandlers = [];
var highlightedModules = [];
var checkboxes = [];
var bomCheckboxes = "";
var highlightpin1 = false;
var lastClicked;

function dbg(html) {
  dbgdiv.innerHTML = html;
}

function setDarkMode(value) {
  if (value) {
    topmostdiv.classList.add("dark");
  } else {
    topmostdiv.classList.remove("dark");
  }
  writeStorage("darkmode", value);
  if (initDone) {
    redrawCanvas(allcanvas.front);
    redrawCanvas(allcanvas.back);
  }
}

function setHighlightPin1(value) {
  writeStorage("highlightpin1", value);
  highlightpin1 = value;
  if (initDone) {
    redrawCanvas(allcanvas.front);
    redrawCanvas(allcanvas.back);
  }
}

function getStoredCheckboxRefs(checkbox) {
  function convert(ref) {
    var intref = parseInt(ref);
    if (isNaN(intref)) {
      for (var i = 0; i < pcbdata.modules.length; i++) {
        if (pcbdata.modules[i].ref == ref) {
          return i;
        }
      }
      return -1;
    } else {
      return intref;
    }
  }
  var existingRefs = readStorage("checkbox_" + checkbox);
  if (!existingRefs) {
    return new Set();
  } else {
    return new Set(existingRefs.split(",").map(r => convert(r)));
  }
}

function getCheckboxState(checkbox, references) {
  var storedRefsSet = getStoredCheckboxRefs(checkbox);
  var currentRefsSet = new Set(references.map(r => r[1]));
  // Get difference of current - stored
  var difference = new Set(currentRefsSet);
  for (ref of storedRefsSet) {
    difference.delete(ref);
  }
  if (difference.size == 0) {
    // All the current refs are stored
    return "checked";
  } else if (difference.size == currentRefsSet.size) {
    // None of the current refs are stored
    return "unchecked";
  } else {
    // Some of the refs are stored
    return "indeterminate";
  }
}

function setBomCheckboxState(checkbox, element, references) {
  var state = getCheckboxState(checkbox, references);
  element.checked = (state == "checked");
  element.indeterminate = (state == "indeterminate");
}

function createCheckboxChangeHandler(checkbox, references) {
  return function() {
    refsSet = getStoredCheckboxRefs(checkbox);
    if (this.checked) {
      // checkbox ticked
      for (var ref of references) {
        refsSet.add(ref[1]);
      }
    } else {
      // checkbox unticked
      for (var ref of references) {
        refsSet.delete(ref[1]);
      }
    }
    writeStorage("checkbox_" + checkbox, [...refsSet].join(","));
  }
}

function createRowHighlightHandler(rowid, refs) {
  return function() {
    if (currentHighlightedRowId) {
      if (currentHighlightedRowId == rowid) {
        return;
      }
      document.getElementById(currentHighlightedRowId).classList.remove("highlighted");
    }
    document.getElementById(rowid).classList.add("highlighted");
    currentHighlightedRowId = rowid;
    highlightedModules = refs.map(r => r[1]);
    drawHighlights();
  }
}

function entryMatches(entry) {
  // check refs
  for (var ref of entry[3]) {
    if (ref[0].toLowerCase().indexOf(filter) >= 0) {
      return true;
    }
  }
  // check extra fields
  for (var i in config.extra_fields) {
    if (entry[4][i].toLowerCase().indexOf(filter) >= 0) {
      return true;
    }
  }
  // check value
  if (entry[1].toLowerCase().indexOf(filter) >= 0) {
    return true;
  }
  // check footprint
  if (entry[2].toLowerCase().indexOf(filter) >= 0) {
    return true;
  }
  return false;
}

function findRefInEntry(entry) {
  return entry[3].filter(r => r[0].toLowerCase() == reflookup);
}

function highlightFilter(s) {
  if (!filter) {
    return s;
  }
  var parts = s.toLowerCase().split(filter);
  if (parts.length == 1) {
    return s;
  }
  var r = "";
  var pos = 0;
  for (var i in parts) {
    if (i > 0) {
      r += '<mark class="highlight">' +
        s.substring(pos, pos + filter.length) +
        '</mark>';
      pos += filter.length;
    }
    r += s.substring(pos, pos + parts[i].length);
    pos += parts[i].length;
  }
  return r;
}

function checkboxSetUnsetAllHandler(checkboxname) {
  return function() {
    var checkboxnum = 0;
    while (checkboxnum < checkboxes.length &&
      checkboxes[checkboxnum].toLowerCase() != checkboxname.toLowerCase()) {
      checkboxnum++;
    }
    if (checkboxnum >= checkboxes.length) {
      return;
    }
    var allset = true;
    var checkbox;
    var row;
    for (row of bombody.childNodes) {
      checkbox = row.childNodes[checkboxnum + 1].childNodes[0];
      if (!checkbox.checked || checkbox.indeterminate) {
        allset = false;
        break;
      }
    }
    for (row of bombody.childNodes) {
      checkbox = row.childNodes[checkboxnum + 1].childNodes[0];
      checkbox.checked = !allset;
      checkbox.indeterminate = false;
      checkbox.onchange();
    }
  }
}

function createColumnHeader(name, cls, comparator) {
  var th = document.createElement("TH");
  th.innerHTML = name;
  th.classList.add(cls);
  th.style.cursor = "pointer";
  var span = document.createElement("SPAN");
  span.classList.add("sortmark");
  span.classList.add("none");
  th.appendChild(span);
  th.onclick = function() {
    if (currentSortColumn && this !== currentSortColumn) {
      // Currently sorted by another column
      currentSortColumn.childNodes[1].classList.remove(currentSortOrder);
      currentSortColumn.childNodes[1].classList.add("none");
      currentSortColumn = null;
      currentSortOrder = null;
    }
    if (currentSortColumn && this === currentSortColumn) {
      // Already sorted by this column
      if (currentSortOrder == "asc") {
        // Sort by this column, descending order
        bomSortFunction = function(a, b) {
          return -comparator(a, b);
        }
        currentSortColumn.childNodes[1].classList.remove("asc");
        currentSortColumn.childNodes[1].classList.add("desc");
        currentSortOrder = "desc";
      } else {
        // Unsort
        bomSortFunction = null;
        currentSortColumn.childNodes[1].classList.remove("desc");
        currentSortColumn.childNodes[1].classList.add("none");
        currentSortColumn = null;
        currentSortOrder = null;
      }
    } else {
      // Sort by this column, ascending order
      bomSortFunction = comparator;
      currentSortColumn = this;
      currentSortColumn.childNodes[1].classList.remove("none");
      currentSortColumn.childNodes[1].classList.add("asc");
      currentSortOrder = "asc";
    }
    populateBomBody();
  }
  return th;
}

function populateBomHeader() {
  while (bomhead.firstChild) {
    bomhead.removeChild(bomhead.firstChild);
  }
  var tr = document.createElement("TR");
  var th = document.createElement("TH");
  th.classList.add("numCol");
  tr.appendChild(th);
  checkboxes = bomCheckboxes.split(",").filter((e) => e);
  var checkboxCompareClosure = function(checkbox) {
    return (a, b) => {
      var stateA = getCheckboxState(checkbox, a[3]);
      var stateB = getCheckboxState(checkbox, b[3]);
      if (stateA > stateB) return -1;
      if (stateA < stateB) return 1;
      return 0;
    }
  }
  for (var checkbox of checkboxes) {
    th = createColumnHeader(
      checkbox, "bom-checkbox", checkboxCompareClosure(checkbox));
    th.onclick = fancyDblClickHandler(
      th, th.onclick.bind(th), checkboxSetUnsetAllHandler(checkbox));
    tr.appendChild(th);
  }
  tr.appendChild(createColumnHeader("References", "References", (a, b) => {
    var i = 0;
    while (i < a[3].length && i < b[3].length) {
      if (a[3][i] != b[3][i]) return a[3][i] > b[3][i] ? 1 : -1;
      i++;
    }
    return a[3].length - b[3].length;
  }));
  // Extra fields
  if (config.extra_fields.length > 0) {
    var extraFieldCompareClosure = function(fieldIndex) {
      return (a, b) => {
        var fa = a[4][fieldIndex];
        var fb = b[4][fieldIndex];
        if (fa != fb) return fa > fb ? 1 : -1;
        else return 0;
      }
    }
    for (var i in config.extra_fields) {
      tr.appendChild(createColumnHeader(
        config.extra_fields[i], "extra", extraFieldCompareClosure(i)));
    }
  }
  tr.appendChild(createColumnHeader("Value", "Value", (a, b) => {
    return valueCompare(a[5], b[5], a[1], b[1]);
  }));
  tr.appendChild(createColumnHeader("Footprint", "Footprint", (a, b) => {
    if (a[2] != b[2]) return a[2] > b[2] ? 1 : -1;
    else return 0;
  }));
  tr.appendChild(createColumnHeader("Quantity", "Quantity", (a, b) => {
    return a[3].length - b[3].length;
  }));
  bomhead.appendChild(tr);
}

function populateBomBody() {
  while (bom.firstChild) {
    bom.removeChild(bom.firstChild);
  }
  highlightHandlers = [];
  currentHighlightedRowId = null;
  var first = true;
  switch (canvaslayout) {
    case 'F':
      bomtable = pcbdata.bom.F;
      break;
    case 'FB':
      bomtable = pcbdata.bom.both;
      break;
    case 'B':
      bomtable = pcbdata.bom.B;
      break;
  }
  if (bomSortFunction) {
    bomtable = bomtable.slice().sort(bomSortFunction);
  }
  for (var i in bomtable) {
    var bomentry = bomtable[i];
    if (filter && !entryMatches(bomentry)) {
      continue;
    }
    var references = bomentry[3];
    if (reflookup) {
      references = findRefInEntry(bomentry);
      if (references.length == 0) {
        continue;
      }
    }
    var tr = document.createElement("TR");
    var td = document.createElement("TD");
    var rownum = +i + 1;
    tr.id = "bomrow" + rownum;
    td.textContent = rownum;
    tr.appendChild(td);
    // Checkboxes
    for (var checkbox of checkboxes) {
      if (checkbox) {
        td = document.createElement("TD");
        var input = document.createElement("input");
        input.type = "checkbox";
        input.onchange = createCheckboxChangeHandler(checkbox, references);
        setBomCheckboxState(checkbox, input, references);
        td.appendChild(input);
        tr.appendChild(td);
      }
    }
    // References
    td = document.createElement("TD");
    td.innerHTML = highlightFilter(references.map(r => r[0]).join(", "));
    tr.appendChild(td);
    // Extra fields
    for (var i in config.extra_fields) {
      td = document.createElement("TD");
      td.innerHTML = highlightFilter(bomentry[4][i]);
      tr.appendChild(td);
    }
    // Value
    td = document.createElement("TD");
    td.innerHTML = highlightFilter(bomentry[1]);
    tr.appendChild(td);
    // Footprint
    td = document.createElement("TD");
    td.innerHTML = highlightFilter(bomentry[2]);
    tr.appendChild(td);
    // Quantity
    td = document.createElement("TD");
    td.textContent = bomentry[3].length;
    tr.appendChild(td);
    bom.appendChild(tr);
    var handler = createRowHighlightHandler(tr.id, references);
    tr.onmousemove = handler;
    highlightHandlers.push({
      id: tr.id,
      handler: handler,
      refs: references
    });
    if ((filter || reflookup) && first) {
      handler();
      first = false;
    }
  }
}

function highlightPreviousRow() {
  if (!currentHighlightedRowId) {
    highlightHandlers[highlightHandlers.length - 1].handler();
  } else {
    if (highlightHandlers.length > 1 &&
      highlightHandlers[0].id == currentHighlightedRowId) {
      highlightHandlers[highlightHandlers.length - 1].handler();
    } else {
      for (var i = 0; i < highlightHandlers.length - 1; i++) {
        if (highlightHandlers[i + 1].id == currentHighlightedRowId) {
          highlightHandlers[i].handler();
          break;
        }
      }
    }
  }
  smoothScrollToRow(currentHighlightedRowId);
}

function highlightNextRow() {
  if (!currentHighlightedRowId) {
    highlightHandlers[0].handler();
  } else {
    if (highlightHandlers.length > 1 &&
      highlightHandlers[highlightHandlers.length - 1].id == currentHighlightedRowId) {
      highlightHandlers[0].handler();
    } else {
      for (var i = 1; i < highlightHandlers.length; i++) {
        if (highlightHandlers[i - 1].id == currentHighlightedRowId) {
          highlightHandlers[i].handler();
          break;
        }
      }
    }
  }
  smoothScrollToRow(currentHighlightedRowId);
}

function populateBomTable() {
  populateBomHeader();
  populateBomBody();
}

function modulesClicked(moduleIndexes) {
  var lastClickedIndex = moduleIndexes.indexOf(lastClicked);
  var index = moduleIndexes[(lastClickedIndex + 1) % moduleIndexes.length];
  for (var handler of highlightHandlers) {
    if (handler.refs.map(r => r[1]).indexOf(index) >= 0) {
      lastClicked = index;
      handler.handler();
      smoothScrollToRow(currentHighlightedRowId);
      break;
    }
  }
}

function updateFilter(input) {
  filter = input.toLowerCase();
  populateBomTable();
}

function updateRefLookup(input) {
  reflookup = input.toLowerCase();
  populateBomTable();
}

function silkscreenVisible(visible) {
  if (visible) {
    allcanvas.front.silk.style.display = "";
    allcanvas.back.silk.style.display = "";
    writeStorage("silkscreenVisible", true);
  } else {
    allcanvas.front.silk.style.display = "none";
    allcanvas.back.silk.style.display = "none";
    writeStorage("silkscreenVisible", false);
  }
}

function changeCanvasLayout(layout) {
  document.getElementById("fl-btn").classList.remove("depressed");
  document.getElementById("fb-btn").classList.remove("depressed");
  document.getElementById("bl-btn").classList.remove("depressed");
  switch (layout) {
    case 'F':
      document.getElementById("fl-btn").classList.add("depressed");
      if (bomlayout != "bom-only") {
        canvassplit.collapse(1);
      }
      break;
    case 'B':
      document.getElementById("bl-btn").classList.add("depressed");
      if (bomlayout != "bom-only") {
        canvassplit.collapse(0);
      }
      break;
    default:
      document.getElementById("fb-btn").classList.add("depressed");
      if (bomlayout != "bom-only") {
        canvassplit.setSizes([50, 50]);
      }
  }
  canvaslayout = layout;
  writeStorage("canvaslayout", layout);
  resizeAll();
  populateBomTable();
}

function populateMetadata() {
  document.getElementById("title").innerHTML = pcbdata.metadata.title;
  document.getElementById("revision").innerHTML = "Rev: " + pcbdata.metadata.revision;
  document.getElementById("company").innerHTML = pcbdata.metadata.company;
  document.getElementById("filedate").innerHTML = pcbdata.metadata.date;
  if (pcbdata.metadata.title != "") {
    document.title = pcbdata.metadata.title + " BOM";
  }
}

function changeBomLayout(layout) {
  document.getElementById("bom-btn").classList.remove("depressed");
  document.getElementById("lr-btn").classList.remove("depressed");
  document.getElementById("tb-btn").classList.remove("depressed");
  switch (layout) {
    case 'bom-only':
      document.getElementById("bom-btn").classList.add("depressed");
      if (bomsplit) {
        bomsplit.destroy();
        bomsplit = null;
        canvassplit.destroy();
        canvassplit = null;
      }
      document.getElementById("frontcanvas").style.display = "none";
      document.getElementById("backcanvas").style.display = "none";
      document.getElementById("bot").style.height = "";
      break;
    case 'top-bottom':
      document.getElementById("tb-btn").classList.add("depressed");
      document.getElementById("frontcanvas").style.display = "";
      document.getElementById("backcanvas").style.display = "";
      document.getElementById("bot").style.height = "calc(100% - 80px)";
      document.getElementById("bomdiv").classList.remove("split-horizontal");
      document.getElementById("canvasdiv").classList.remove("split-horizontal");
      document.getElementById("frontcanvas").classList.add("split-horizontal");
      document.getElementById("backcanvas").classList.add("split-horizontal");
      if (bomsplit) {
        bomsplit.destroy();
        bomsplit = null;
        canvassplit.destroy();
        canvassplit = null;
      }
      bomsplit = Split(['#bomdiv', '#canvasdiv'], {
        sizes: [50, 50],
        onDragEnd: resizeAll,
        direction: "vertical",
        gutterSize: 5
      });
      canvassplit = Split(['#frontcanvas', '#backcanvas'], {
        sizes: [50, 50],
        gutterSize: 5,
        onDragEnd: resizeAll
      });
      break;
    case 'left-right':
      document.getElementById("lr-btn").classList.add("depressed");
      document.getElementById("frontcanvas").style.display = "";
      document.getElementById("backcanvas").style.display = "";
      document.getElementById("bot").style.height = "calc(100% - 80px)";
      document.getElementById("bomdiv").classList.add("split-horizontal");
      document.getElementById("canvasdiv").classList.add("split-horizontal");
      document.getElementById("frontcanvas").classList.remove("split-horizontal");
      document.getElementById("backcanvas").classList.remove("split-horizontal");
      if (bomsplit) {
        bomsplit.destroy();
        bomsplit = null;
        canvassplit.destroy();
        canvassplit = null;
      }
      bomsplit = Split(['#bomdiv', '#canvasdiv'], {
        sizes: [50, 50],
        onDragEnd: resizeAll,
        gutterSize: 5
      });
      canvassplit = Split(['#frontcanvas', '#backcanvas'], {
        sizes: [50, 50],
        gutterSize: 5,
        direction: "vertical",
        onDragEnd: resizeAll
      });
  }
  bomlayout = layout;
  writeStorage("bomlayout", layout);
  changeCanvasLayout(canvaslayout);
}

function focusFilterField() {
  focusInputField(document.getElementById("filter"));
}

function focusRefLookupField() {
  focusInputField(document.getElementById("reflookup"));
}

function toggleBomCheckbox(bomrowid, checkboxnum) {
  if (!bomrowid || checkboxnum > checkboxes.length) {
    return;
  }
  var bomrow = document.getElementById(bomrowid);
  var checkbox = bomrow.childNodes[checkboxnum].childNodes[0];
  checkbox.checked = !checkbox.checked;
  checkbox.indeterminate = false;
  checkbox.onchange();
}

function checkBomCheckbox(bomrowid, checkboxname) {
  var checkboxnum = 0;
  while (checkboxnum < checkboxes.length &&
    checkboxes[checkboxnum].toLowerCase() != checkboxname.toLowerCase()) {
    checkboxnum++;
  }
  if (!bomrowid || checkboxnum >= checkboxes.length) {
    return;
  }
  var bomrow = document.getElementById(bomrowid);
  var checkbox = bomrow.childNodes[checkboxnum + 1].childNodes[0];
  checkbox.checked = true;
  checkbox.indeterminate = false;
  checkbox.onchange();
}

function setBomCheckboxes(value) {
  bomCheckboxes = value;
  writeStorage("bomCheckboxes", value);
  populateBomTable();
}

document.onkeydown = function(e) {
  switch (e.key) {
    case "n":
      if (document.activeElement.type == "text") {
        return;
      }
      if (currentHighlightedRowId !== null) {
        checkBomCheckbox(currentHighlightedRowId, "placed");
        highlightNextRow();
        e.preventDefault();
      }
      break;
    case "ArrowUp":
      highlightPreviousRow();
      e.preventDefault();
      break;
    case "ArrowDown":
      highlightNextRow();
      e.preventDefault();
      break;
    default:
      break;
  }
  if (e.altKey) {
    switch (e.key) {
      case "f":
        focusFilterField();
        e.preventDefault();
        break;
      case "r":
        focusRefLookupField();
        e.preventDefault();
        break;
      case "z":
        changeBomLayout("bom-only");
        e.preventDefault();
        break;
      case "x":
        changeBomLayout("left-right");
        e.preventDefault();
        break;
      case "c":
        changeBomLayout("top-bottom");
        e.preventDefault();
        break;
      case "v":
        changeCanvasLayout("F");
        e.preventDefault();
        break;
      case "b":
        changeCanvasLayout("FB");
        e.preventDefault();
        break;
      case "n":
        changeCanvasLayout("B");
        e.preventDefault();
        break;
      default:
        break;
    }
    if (e.key >= '1' && e.key <= '9') {
      toggleBomCheckbox(currentHighlightedRowId, parseInt(e.key));
    }
  }
}

function initDefaults() {
  bomlayout = readStorage("bomlayout");
  if (bomlayout === null) {
    bomlayout = config.bom_view;
  }
  if (!['bom-only', 'left-right', 'top-bottom'].includes(bomlayout)) {
    bomlayout = config.bom_view;
  }
  canvaslayout = readStorage("canvaslayout");
  if (canvaslayout === null) {
    canvaslayout = config.layer_view;
  }
  bomCheckboxes = readStorage("bomCheckboxes");
  if (bomCheckboxes === null) {
    bomCheckboxes = config.checkboxes;
  }
  document.getElementById("bomCheckboxes").value = bomCheckboxes;

  var b = readStorage("silkscreenVisible");
  if (b === null) {
    b = config.show_silkscreen;
  }
  document.getElementById("silkscreenCheckbox").checked = b;
  silkscreenVisible(b);

  b = readStorage("redrawOnDrag");
  if (b === null) {
    b = config.redraw_on_drag;
  }
  document.getElementById("dragCheckbox").checked = b;
  setRedrawOnDrag(b);

  b = readStorage("darkmode");
  if (b === null) {
    b = config.dark_mode;
  }
  document.getElementById("darkmodeCheckbox").checked = b;
  setDarkMode(b);

  b = readStorage("highlightpin1");
  if (b === null) {
    b = config.highlight_pin1;
  }
  document.getElementById("highlightpin1Checkbox").checked = b;
  setHighlightPin1(b);

  boardRotation = readStorage("boardRotation");
  if (boardRotation === null) {
    boardRotation = config.board_rotation * 5;
  } else {
    boardRotation = parseInt(boardRotation);
  }
  document.getElementById("boardRotation").value = boardRotation / 5;
  document.getElementById("rotationDegree").textContent = boardRotation;
}

window.onload = function(e) {
  initUtils();
  initRender();
  initStorage();
  initDefaults();
  cleanGutters();
  populateMetadata();
  dbgdiv = document.getElementById("dbg");
  bom = document.getElementById("bombody");
  bomhead = document.getElementById("bomhead");
  filter = "";
  reflookup = "";
  initDone = true;
  // Triggers render
  changeBomLayout(bomlayout);
}

window.onresize = resizeAll;
window.matchMedia("print").addListener(resizeAll);

///////////////////////////////////////////////

  </script>
</head>

<body>
<div id="topmostdiv" style="width: 100%; height: 100%">
  <div id="top">
    <div style="float: right;">
      <div class="hideonprint menu" style="float: right; margin: 10px; top: 8px;">
        <button class="menubtn"></button>
        <div class="menu-content">
          <label class="menu-label menu-label-top">
            <input id="darkmodeCheckbox" type="checkbox" onchange="setDarkMode(this.checked)">
            Dark mode
          </label>
          <label class="menu-label">
            <input id="silkscreenCheckbox" type="checkbox" checked onchange="silkscreenVisible(this.checked)">
            Show silkscreen
          </label>
          <label class="menu-label">
            <input id="highlightpin1Checkbox" type="checkbox" onchange="setHighlightPin1(this.checked)">
            Highlight first pin
          </label>
          <label class="menu-label">
            <input id="dragCheckbox" type="checkbox" checked onchange="setRedrawOnDrag(this.checked)">
            Continuous redraw on drag
          </label>
          <label class="menu-label">
            <span>Board rotation</span>
            <span style="float: right"><span id="rotationDegree">0</span>&#176;</span>
            <input id="boardRotation" type="range" min="-36" max="36" value="0" class="slider" oninput="setBoardRotation(this.value)">
          </label>
          <label class="menu-label">
            <div style="margin-left: 5px">Bom checkboxes</div>
            <input id="bomCheckboxes" class="menu-textbox" type=text
                   oninput="setBomCheckboxes(this.value)">
          </label>
          <label class="menu-label">
            <span class="shameless-plug">
              <span>Created using</span>
              <a target="blank" href="https://github.com/openscopeproject/InteractiveHtmlBom">InteractiveHtmlBom</a>
            </span>
          </label>
        </div>
      </div>
      <div class="button-container hideonprint"
           style="float: right; margin: 10px; position: relative; top: 8px">
        <button id="fl-btn" class="left-most-button" onclick="changeCanvasLayout('F')"
                title="Front only">F
        </button>
        <button id="fb-btn" class="middle-button" onclick="changeCanvasLayout('FB')"
                title="Front and Back">FB
        </button>
        <button id="bl-btn" class="right-most-button" onclick="changeCanvasLayout('B')"
                title="Back only">B
        </button>
      </div>
      <div class="button-container hideonprint"
           style="float: right; margin: 10px; position: relative; top: 8px">
        <button id="bom-btn" class="left-most-button" onclick="changeBomLayout('bom-only')"
                title="BOM only"></button>
        <button id="lr-btn" class="middle-button" onclick="changeBomLayout('left-right')"
                title="BOM left, drawings right"></button>
        <button id="tb-btn" class="right-most-button" onclick="changeBomLayout('top-bottom')"
                title="BOM top, drawings bot"></button>
      </div>
    </div>
    <div id="fileinfodiv" style="overflow: auto;">
      <table class="fileinfo">
        <tbody>
          <tr>
            <td id="title" class="title" style="width: 70%">
              Title
            </td>
            <td id="revision" class="title" style="width: 30%">
              Revision
            </td>
          </tr>
          <tr>
            <td id="company">
              Kicad version
            </td>
            <td id="filedate">
              Date
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div id="bot" class="split" style="height: calc(100% - 80px)">
    <div id="bomdiv" class="split split-horizontal">
      <div style="width: 100%">
        <input id="reflookup" class="searchbox reflookup hideonprint" type="text" placeholder="Ref lookup"
               oninput="updateRefLookup(this.value)">
        <input id="filter" class="searchbox filter hideonprint" type="text" placeholder="Filter"
               oninput="updateFilter(this.value)">
        <div class="button-container hideonprint" style="float: left">
          <button id="copy" title="Copy bom table to clipboard"
               onclick="copyToClipboard()"></button>
        </div>
      </div>
      <div id="dbg"></div>
      <table class="bom">
        <thead id="bomhead">
        </thead>
        <tbody id="bombody">
        </tbody>
      </table>
    </div>
    <div id="canvasdiv" class="split split-horizontal">
      <div id="frontcanvas" class="split" style="overflow: hidden">
        <div style="position: relative; width: 100%; height: 100%;">
          <canvas id="F_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
          <canvas id="F_slk" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
          <canvas id="F_hl" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
        </div>
      </div>
      <div id="backcanvas" class="split" style="overflow: hidden">
        <div style="position: relative; width: 100%; height: 100%;">
          <canvas id="B_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
          <canvas id="B_slk" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
          <canvas id="B_hl" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
        </div>
      </div>
    </div>
  </div>
</div>
</body>

</html>
